Page MenuHomePhorge

Fix possibly dangling reference to a temporary
ClosedPublic

Authored by tusooa on Jun 19 2024, 8:38 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Fri, Aug 23, 11:27 PM
Unknown Object (File)
Fri, Aug 23, 12:55 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable