Attached is a new patch, which uses GDM to store the VarDecls of globals previously initialized along the path.
Thanks for the suggestion, Anna.
|
staticLocals.diff
Description: Binary data
Put another way, this patch seems to rely on the value of a variable being "uninitialized" to indicate whether or not the initializer has been executed. That's not a valid assumption. For example:
static id x = foo(x);
is "okay" in Objective-C.
… or rather Objective-C++.
$ cat t.mm #include <stdio.h>
id foo(id x) { printf("%p\n", x); return x; }
int main() { static id x = foo(x); }
What are the semantics in this case? Would the value be uninitialized or 0? $ clang++ t.mm $ ./a.out 0x0
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
|
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits