@@ -3879,6 +3879,7 @@ check_index(struct compiler *c, expr_ty e, slice_ty s)
|
3879 | 3879 | } |
3880 | 3880 | } |
3881 | 3881 | |
| 3882 | +// Return 1 if the method call was optimized, -1 if not, and 0 on error. |
3882 | 3883 | static int |
3883 | 3884 | maybe_optimize_method_call(struct compiler *c, expr_ty e) |
3884 | 3885 | { |
@@ -3912,8 +3913,10 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e)
|
3912 | 3913 | static int |
3913 | 3914 | compiler_call(struct compiler *c, expr_ty e) |
3914 | 3915 | { |
3915 | | -if (maybe_optimize_method_call(c, e) > 0) |
3916 | | -return 1; |
| 3916 | +int ret = maybe_optimize_method_call(c, e); |
| 3917 | +if (ret >= 0) { |
| 3918 | +return ret; |
| 3919 | + } |
3917 | 3920 | if (!check_caller(c, e->v.Call.func)) { |
3918 | 3921 | return 0; |
3919 | 3922 | } |
|