summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorfche <fche>2008-03-26 21:22:26 +0000
committerfche <fche>2008-03-26 21:22:26 +0000
commit0301cfe75d47bc8e26607ef8372c76239a487113 (patch)
tree2a2d3cd225cce5689347f8fbff61a67e3aad2c15 /translate.cxx
parent9b9d592ebd99522606996202a22e6382e7945752 (diff)
downloadsystemtap-steved-0301cfe75d47bc8e26607ef8372c76239a487113.tar.gz
systemtap-steved-0301cfe75d47bc8e26607ef8372c76239a487113.tar.xz
systemtap-steved-0301cfe75d47bc8e26607ef8372c76239a487113.zip
2008-03-26 Frank Ch. Eigler <fche@elastic.org>
* translate.cxx (emit_function): Set context last_stmt, in case an error occurs during the function.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/translate.cxx b/translate.cxx
index 2bfacefc..f30fca7b 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -1360,6 +1360,9 @@ c_unparser::emit_function (functiondecl* v)
o->newline() << "#define THIS l";
o->newline() << "if (0) goto out;"; // make sure out: is marked used
+ // set this, in case embedded-c code sets last_error but doesn't otherwise identify itself
+ o->newline() << "c->last_stmt = " << lex_cast_qstring(*v->tok) << ";";
+
// check/increment nesting level
o->newline() << "if (unlikely (c->nesting+2 >= MAXNESTING)) {";
o->newline(1) << "c->last_error = \"MAXNESTING exceeded\";";