diff options
author | eteo <eteo> | 2006-04-22 06:45:59 +0000 |
---|---|---|
committer | eteo <eteo> | 2006-04-22 06:45:59 +0000 |
commit | 79cd1b2795241e23c5950f6ec7a7fe666d25ad70 (patch) | |
tree | 2454640b268456cde374a5ef68d1c5ba690bc03e /translate.cxx | |
parent | 6f05b6abdb6443abdae275c1c6565aaf7e2162ba (diff) | |
download | systemtap-steved-79cd1b2795241e23c5950f6ec7a7fe666d25ad70.tar.gz systemtap-steved-79cd1b2795241e23c5950f6ec7a7fe666d25ad70.tar.xz systemtap-steved-79cd1b2795241e23c5950f6ec7a7fe666d25ad70.zip |
2006-04-21 Eugene Teo <eteo@redhat.com>
PR 1326
* translate.cxx (c_unparser::visit_binary_expression): Handle
negative left and right shift count.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/translate.cxx b/translate.cxx index e0b1f8aa..83d6dd93 100644 --- a/translate.cxx +++ b/translate.cxx @@ -2468,9 +2468,7 @@ c_unparser::visit_binary_expression (binary_expression* e) e->op == "*" || e->op == "&" || e->op == "|" || - e->op == "^" || - e->op == "<<" || - e->op == ">>") + e->op == "^") { o->line() << "(("; e->left->visit (this); @@ -2478,6 +2476,15 @@ c_unparser::visit_binary_expression (binary_expression* e) e->right->visit (this); o->line() << "))"; } + else if (e->op == ">>" || + e->op == "<<") + { + o->line() << "(("; + e->left->visit (this); + o->line() << ") " << e->op << "max(min("; + e->right->visit (this); + o->line() << ", (int64_t)64LL), (int64_t)0LL))"; // between 0 and 64 + } else if (e->op == "/" || e->op == "%") { |