Page MenuHomePhorge

Fix possibly dangling reference to a temporary
ClosedPublic

Authored by tusooa on Jun 19 2024, 8:38 PM.
Tags
None
Referenced Files
F114520: D61.1732558631.diff
Sun, Nov 24, 10:17 AM
F113879: D61.1732489391.diff
Sat, Nov 23, 3:03 PM
F113878: D61.1732489387.diff
Sat, Nov 23, 3:03 PM
F113691: D61.1732488519.diff
Sat, Nov 23, 2:48 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