Skip to content

Commit

Permalink
Return 0 in lookup_or_init error path
Browse files Browse the repository at this point in the history
Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
Brenden Blanco committed May 29, 2015
1 parent d550d32 commit d23d699
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cc/b_frontend_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
txt += "if (!leaf) {";
txt += " " + update + ", " + arg0 + ", " + arg1 + ", " + map_update_policy + ");";
txt += " leaf = " + lookup + ", " + arg0 + ");";
txt += " if (!leaf) return -1;";
txt += " if (!leaf) return 0;";
txt += "}";
txt += "leaf;})";
} else {
Expand Down Expand Up @@ -137,7 +137,7 @@ bool BTypeVisitor::VisitArraySubscriptExpr(ArraySubscriptExpr *Arr) {
txt += " typeof(" + name + ".leaf) zleaf = {0};";
txt += " " + update + ", " + args + ", &zleaf, " + map_update_policy + ");";
txt += " leaf = " + lookup + ", " + args + ");";
txt += " if (!leaf) return -1;";
txt += " if (!leaf) return 0;";
txt += "}";
txt += "leaf;}))";
rewriter_.ReplaceText(SourceRange(Arr->getLocStart(), Arr->getLocEnd()), txt);
Expand Down

0 comments on commit d23d699

Please sign in to comment.