Page MenuHomePhorge

Fix possibly dangling reference to a temporary
ClosedPublic

Authored by tusooa on Jun 19 2024, 8:38 PM.
Tags
None
Referenced Files
F27084: D61.1726602000.diff
Mon, Sep 16, 12:40 PM
Unknown Object (File)
Sun, Sep 8, 11:09 AM
Unknown Object (File)
Sat, Aug 31, 6:26 AM
Unknown Object (File)
Sun, Aug 25, 9:06 AM
Unknown Object (File)
Sat, Aug 24, 11:41 PM
Unknown Object (File)
Sat, Aug 24, 11:41 PM
Unknown Object (File)
Sat, Aug 24, 11:17 PM
Unknown Object (File)
Sat, Aug 24, 1:20 AM
Subscribers
None

Details

Summary

These two are <function that returns JsonWrap>.get(), where the JsonWrap is a temporary. We got lucky because the shared internal structure stored in the JsonWrap happens to have not been destroyed. This commit stores a local JsonWrap first, and then get a json reference out of it. This helps avoid the extra copy of the json while ensuring the shared structure does not get destroyed.

Type: fix

CCBUG: https://iron.lily-is.land/T15

Test Plan

Verify that the build logs does not have -Wdangling-reference warnings.

Diff Detail

Repository
rL libkazv
Branch
tusooa/stacked
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 89
Build 167: GitLab CI for libkazv
Build 166: arc lint + arc unit