diff options
author | fche <fche> | 2005-08-30 01:54:44 +0000 |
---|---|---|
committer | fche <fche> | 2005-08-30 01:54:44 +0000 |
commit | ba4a90fd18a9c94624a38d660c6e7ca6230c271f (patch) | |
tree | 82a060bc5f9db3001c0e09db8372caf8bfdfc2dc /translate.cxx | |
parent | 55a030a179fdfd1e887d95d5c0050004bee27fcf (diff) | |
download | systemtap-steved-ba4a90fd18a9c94624a38d660c6e7ca6230c271f.tar.gz systemtap-steved-ba4a90fd18a9c94624a38d660c6e7ca6230c271f.tar.xz systemtap-steved-ba4a90fd18a9c94624a38d660c6e7ca6230c271f.zip |
2005-08-29 Frank Ch. Eigler <fche@redhat.com>
* stapprobes.5.in, stapfuncs.5.in, stapex.5.in: New man pages.
* stap.1.in: Moved some content out.
* Makefile.am (man_MANS): Add new man pages.
* configure.ac (AC_CONFIG_FILES): Add them.
* systemtap.spec.in: Package them.
* Makefile.in, configure: Regenerated.
* buildrun.cxx (run_pass): Pass "-r" to stpd.
* translate.cxx (emit_common_header): Wrap try/catch around
variable decls, to improve exception particularity.
(visit_literal_number): Emit as unsigned literal, which is
actually a subtle correctness issue.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/translate.cxx b/translate.cxx index 71241d00..a8d768ae 100644 --- a/translate.cxx +++ b/translate.cxx @@ -564,8 +564,15 @@ c_unparser::emit_common_header () for (unsigned j=0; j<dp->locals.size(); j++) { vardecl* v = dp->locals[j]; - o->newline() << c_typename (v->type) << " " - << c_varname (v->name) << ";"; + try + { + o->newline() << c_typename (v->type) << " " + << c_varname (v->name) << ";"; + } catch (const semantic_error& e) { + semantic_error e2 (e); + if (e2.tok1 == 0) e2.tok1 = v->tok; + throw e2; + } } c_tmpcounter ct (this); dp->body->visit (& ct); @@ -580,15 +587,29 @@ c_unparser::emit_common_header () o->indent(1); for (unsigned j=0; j<fd->locals.size(); j++) { - vardecl* v = fd->locals[j]; - o->newline() << c_typename (v->type) << " " - << c_varname (v->name) << ";"; + vardecl* v = fd->locals[j]; + try + { + o->newline() << c_typename (v->type) << " " + << c_varname (v->name) << ";"; + } catch (const semantic_error& e) { + semantic_error e2 (e); + if (e2.tok1 == 0) e2.tok1 = v->tok; + throw e2; + } } for (unsigned j=0; j<fd->formal_args.size(); j++) { vardecl* v = fd->formal_args[j]; - o->newline() << c_typename (v->type) << " " - << c_varname (v->name) << ";"; + try + { + o->newline() << c_typename (v->type) << " " + << c_varname (v->name) << ";"; + } catch (const semantic_error& e) { + semantic_error e2 (e); + if (e2.tok1 == 0) e2.tok1 = v->tok; + throw e2; + } } c_tmpcounter ct (this); fd->body->visit (& ct); @@ -1590,7 +1611,8 @@ c_unparser::visit_literal_number (literal_number* e) { // This looks ugly, but tries to be warning-free on 32- and 64-bit // hosts. - o->line() << "((uint64_t)" << e->value << "LL)"; + // NB: this needs to be signed! + o->line() << "((int64_t)" << e->value << "LL)"; } |