Commit f7b1fb34 authored by Teng Qin's avatar Teng Qin Committed by GitHub

Merge pull request #1982 from iovisor/yhs_dev

prevent array subscript expression if base/index is not rewritable
parents c7ccd5b7 a6d7e3af
......@@ -505,6 +505,12 @@ bool ProbeVisitor::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
Expr *idx = E->getIdx();
memb_visited_.insert(E);
if (!rewriter_.isRewritable(GET_BEGINLOC(base)))
return true;
if (!rewriter_.isRewritable(GET_BEGINLOC(idx)))
return true;
string pre, lbracket, rbracket;
LangOptions opts;
SourceLocation lbracket_start, lbracket_end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment