avoid probe rewriting of p->m in &(p->m) (#1831)
Fix issue #1830.
After the rewrite, the code approximately becomes
&({type _val; bpf_probe_read(&_val, sizeof(_val), &(p->m)); _val)
Firstly the rewriting is really unnecessary, and secondly
the compilation will fail since the addressOf cannot take address
of the rvalue _val.
C standard, however, allows the addressOf operand array subscript
expression, e.g.,
&({type _val; bpf_probe_read(&_val, sizeof(_val), &(p->m)); _val)[0]
This patch intends to fix the problem by avoiding
the rewriting in the first place of addrressOf simple member expression.
It still permits addressOf the array subscript expression.
Signed-off-by: Yonghong Song <yhs@fb.com>
Showing
Please register or sign in to comment