Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 77890f6fbf8f3aca926641450cbe885d14277ecd..dcecb89e22f8634236f1d32c7acff57f297ae4d8 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8123,6 +8123,15 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target, |
return false; |
} |
+ // In strong mode it is an error to call a function with too few arguments. |
+ // In that case do not inline because then the arity check would be skipped. |
+ if (is_strong(function->language_mode()) && |
+ arguments_count < function->parameter_count()) { |
+ TraceInline(target, caller, |
+ "too few arguments passed to a strong function"); |
+ return false; |
+ } |
+ |
// ---------------------------------------------------------------- |
// After this point, we've made a decision to inline this function (so |
// TryInline should always return true). |