diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-06-18 17:19:29 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-06-18 17:19:29 -0400 |
commit | ed35c8ac5bc2da83fedfb53d0c283ee8c5c77f39 (patch) | |
tree | e93912836e0d984a4ea722a483ef9bb0cdf1f4a3 | |
parent | 905728a036bf9d5cf0c21d684ad53882489c82c8 (diff) | |
download | systemtap-steved-ed35c8ac5bc2da83fedfb53d0c283ee8c5c77f39.tar.gz systemtap-steved-ed35c8ac5bc2da83fedfb53d0c283ee8c5c77f39.tar.xz systemtap-steved-ed35c8ac5bc2da83fedfb53d0c283ee8c5c77f39.zip |
PR10298: tweak global param initialization for NULL etc.
* translate.cxx (translate_pass): Emit module_parm stuff at the very end.
* testsuite/buildok/null.stp: New test.
-rwxr-xr-x | testsuite/buildok/null.stp | 5 | ||||
-rw-r--r-- | translate.cxx | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/testsuite/buildok/null.stp b/testsuite/buildok/null.stp new file mode 100755 index 00000000..9bcaf3f6 --- /dev/null +++ b/testsuite/buildok/null.stp @@ -0,0 +1,5 @@ +#! stap -p4 + +# PR10298 +global foo = 5 +probe begin { if (foo == NULL) log("hello") } diff --git a/translate.cxx b/translate.cxx index 518e5584..cc634555 100644 --- a/translate.cxx +++ b/translate.cxx @@ -5212,18 +5212,19 @@ translate_pass (systemtap_session& s) s.op->newline(-1) << "}"; s.op->assert_0_indent(); + emit_symbol_data (s); + + s.op->newline() << "MODULE_DESCRIPTION(\"systemtap-generated probe\");"; + s.op->newline() << "MODULE_LICENSE(\"GPL\");"; + s.op->assert_0_indent(); + + // PR10298: attempt to avoid collisions with symbols for (unsigned i=0; i<s.globals.size(); i++) { s.op->newline(); s.up->emit_global_param (s.globals[i]); } s.op->assert_0_indent(); - - emit_symbol_data (s); - - s.op->newline() << "MODULE_DESCRIPTION(\"systemtap-generated probe\");"; - s.op->newline() << "MODULE_LICENSE(\"GPL\");"; - s.op->assert_0_indent(); } catch (const semantic_error& e) { |