Hash :
a06cb368
Author :
Date :
2025-08-12T11:45:43
Fix GCC -Wdangling-pointer warning in NodeStackGuard The previous implementation stored the address of a local member (oldNodeStack) into ConsList::tail, which triggers the warning even though the lifetime is safe within the guard's scope. This change allocates a copy of the previous nodeStack on the heap using std::make_unique, and stores that pointer in tail. This ensures the referenced ConsList object has a lifetime tied to the guard object itself and is not considered a dangling pointer by GCC's static analysis. BUG: angleproject:438226513 Change-Id: Ifea04515db7b1988dff6ec41c60799158b753128 Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6845476 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>