Skip to content

Commit

Permalink
Merge pull request iovisor#1982 from iovisor/yhs_dev
Browse files Browse the repository at this point in the history
prevent array subscript expression if base/index is not rewritable
  • Loading branch information
palmtenor committed Sep 21, 2018
2 parents c7ccd5b + a6d7e3a commit f7b1fb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cc/frontends/clang/b_frontend_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f7b1fb3

Please sign in to comment.