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

Unified Diff: src/parser.cc

Issue 573056: Add fuzzing support for inline runtime functions (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | « src/messages.js ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
===================================================================
--- src/parser.cc (revision 4085)
+++ src/parser.cc (working copy)
@@ -30,6 +30,7 @@
#include "api.h"
#include "ast.h"
#include "bootstrapper.h"
+#include "codegen.h"
#include "compiler.h"
#include "messages.h"
#include "platform.h"
@@ -3832,7 +3833,27 @@
}
}
- // Otherwise we have a runtime call.
+ // Check that the expected number arguments are passed to runtime functions.
+ if (!is_pre_parsing_) {
+ if (function != NULL
+ && function->nargs != -1
+ && function->nargs != args->length()) {
+ ReportMessage("illegal_access", Vector<const char*>::empty());
+ *ok = false;
+ return NULL;
+ } else if (function == NULL && !name.is_null()) {
+ // If this is not a runtime function implemented in C++ it might be an
+ // inlined runtime function.
+ int argc = CodeGenerator::InlineRuntimeCallArgumentsCount(name);
+ if (argc != -1 && argc != args->length()) {
+ ReportMessage("illegal_access", Vector<const char*>::empty());
+ *ok = false;
+ return NULL;
+ }
+ }
+ }
+
+ // Otherwise we have a valid runtime call.
return NEW(CallRuntime(name, function, args));
}
« no previous file with comments | « src/messages.js ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698