compiler_call() needs to check if an error occurred during the
maybe_optimize_method_call() call.
}
}
+// Return 1 if the method call was optimized, -1 if not, and 0 on error.
static int
maybe_optimize_method_call(struct compiler *c, expr_ty e)
{
static int
compiler_call(struct compiler *c, expr_ty e)
{
- if (maybe_optimize_method_call(c, e) > 0)
- return 1;
+ int ret = maybe_optimize_method_call(c, e);
+ if (ret >= 0) {
+ return ret;
+ }
if (!check_caller(c, e->v.Call.func)) {
return 0;
}