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

Unified Diff: test/mjsunit/fuzz-natives.js

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 | « test/cctest/test-log-stack-tracer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/fuzz-natives.js
===================================================================
--- test/mjsunit/fuzz-natives.js (revision 4085)
+++ test/mjsunit/fuzz-natives.js (working copy)
@@ -57,9 +57,17 @@
return new Function(args.join(", "), "return %" + name + "(" + argsStr + ");");
}
-function testArgumentCount(name) {
+function testArgumentCount(name, argc) {
for (var i = 0; i < 10; i++) {
- var func = makeFunction(name, i);
+ var func = null;
+ try {
+ func = makeFunction(name, i);
+ } catch (e) {
+ if (e != "SyntaxError: illegal access") throw e;
+ }
+ if (func === null && i == argc) {
+ throw "unexpected exception";
+ }
var args = [ ];
for (var j = 0; j < i; j++)
args.push(0);
@@ -176,7 +184,7 @@
continue;
print(name);
var argc = nativeInfo[1];
- testArgumentCount(name);
+ testArgumentCount(name, argc);
testArgumentTypes(name, argc);
}
}
« no previous file with comments | « test/cctest/test-log-stack-tracer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698