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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2785623004: Fix #14144 confusing error message misusing a callable object (Closed)
Patch Set: Remove the check to 'call' methods to report closures. Clearer this way. 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
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());

Powered by Google App Engine
This is Rietveld 408576698