1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 14:25:37 +02:00

Bug 572581: Fix uninit field access

MIExpressionsTest.testNestedBaseChildrenBug accesses this field like
this -data-evaluate-expression "*((((*(class Base*) this)).pNested))"
which, as pNested isn't init, can cause a Cannot access memory at
address 0x0 error.

Change-Id: Ie6ba01be3499df6e72e714bc5c02dcd5355468bf
This commit is contained in:
Jonah Graham 2021-04-08 11:41:57 -04:00
parent 31fec42dee
commit 0e4917751e

View file

@ -78,6 +78,7 @@ public:
BaseTest() {}
void test() {
nested = 8;
pNested = &nested;
return;
}
Base Base; // make sure we don't get confused by the same name