Restrict rewrite of unary operators to dereference operator
authorPaul Chaignon <paul.chaignon@gmail.com>
Thu, 23 Feb 2017 09:03:58 +0000 (10:03 +0100)
committerPaul Chaignon <paul.chaignon@gmail.com>
Mon, 6 Mar 2017 20:48:14 +0000 (21:48 +0100)
commit4c6ecb46ea8ebdf00cd7447fb183cd51a34150ba
tree75096279e4217c629027aa5c90007f9eb86721ec
parentd05e66de32beb49edeef69e811a1156237b9b6d7
Restrict rewrite of unary operators to dereference operator

Since the whole expression, unary operator included, is replaced by a
call to bpf_probe_read, the dereference operator is currently the
only unary operator properly rewritten. When rewriting an increment
expression (++val) for instance, the increment operator is lost in
translation.

Trying to rewrite all unary operators sometimes confuses bcc and
results in improper code, for instance when trying to rewrite a
logical negation.
src/cc/frontends/clang/b_frontend_action.cc
tests/python/test_clang.py