Page MenuHomePhorge

Fix possibly dangling reference to a temporary
ClosedPublic

Authored by tusooa on Jun 19 2024, 8:38 PM.
Tags
None
Referenced Files
F163352: D61.1740313224.diff
Sat, Feb 22, 4:20 AM
F163351: D61.1740313220.diff
Sat, Feb 22, 4:20 AM
F163279: D61.1740312915.diff
Sat, Feb 22, 4:15 AM
F163273: D61.1740310340.diff
Sat, Feb 22, 3:32 AM
F163256: D61.1740292400.diff
Fri, Feb 21, 10:33 PM
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