Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2785623004: Fix #14144 confusing error message misusing a callable object (Closed)
Patch Set: Realized that doing .runtimeType == _Closure is unnecessary, doing 'is' now. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | tests/language/vm/no_such_args_error_message_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 1d3937704a34d910e05de19ccb421b8a24a49274..235244d53f989b9d0f23422d4eb7a8a91afb0b58 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -1261,6 +1261,13 @@ class CallSiteInliner : public ValueObject {
TRACE_INLINING(THR_Print(" Bailout: non-closure operator\n"));
continue;
}
+
+ if (call->ArgumentCount() > target.NumParameters() ||
+ call->ArgumentCount() < target.num_fixed_parameters()) {
+ TRACE_INLINING(THR_Print(" Bailout: wrong parameter count\n"));
+ continue;
+ }
+
GrowableArray<Value*> arguments(call->ArgumentCount());
for (int i = 0; i < call->ArgumentCount(); ++i) {
arguments.Add(call->PushArgumentAt(i)->value());
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | tests/language/vm/no_such_args_error_message_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698