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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 15096011: Various minor cctest fixes to make ASAN a bit happier. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 381
382 382
383 TEST(PreParseOverflow) { 383 TEST(PreParseOverflow) {
384 v8::V8::Initialize(); 384 v8::V8::Initialize();
385 385
386 int marker; 386 int marker;
387 i::Isolate::Current()->stack_guard()->SetStackLimit( 387 i::Isolate::Current()->stack_guard()->SetStackLimit(
388 reinterpret_cast<uintptr_t>(&marker) - 128 * 1024); 388 reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
389 389
390 size_t kProgramSize = 1024 * 1024; 390 size_t kProgramSize = 1024 * 1024;
391 i::SmartArrayPointer<char> program( 391 i::SmartArrayPointer<char> program(i::NewArray<char>(kProgramSize + 1));
392 reinterpret_cast<char*>(malloc(kProgramSize + 1)));
393 memset(*program, '(', kProgramSize); 392 memset(*program, '(', kProgramSize);
394 program[kProgramSize] = '\0'; 393 program[kProgramSize] = '\0';
395 394
396 uintptr_t stack_limit = i::Isolate::Current()->stack_guard()->real_climit(); 395 uintptr_t stack_limit = i::Isolate::Current()->stack_guard()->real_climit();
397 396
398 i::Utf8ToUtf16CharacterStream stream( 397 i::Utf8ToUtf16CharacterStream stream(
399 reinterpret_cast<const i::byte*>(*program), 398 reinterpret_cast<const i::byte*>(*program),
400 static_cast<unsigned>(kProgramSize)); 399 static_cast<unsigned>(kProgramSize));
401 i::CompleteParserRecorder log; 400 i::CompleteParserRecorder log;
402 i::Scanner scanner(i::Isolate::Current()->unicode_cache()); 401 i::Scanner scanner(i::Isolate::Current()->unicode_cache());
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 " b = function() { \n" 1297 " b = function() { \n"
1299 " 01; \n" 1298 " 01; \n"
1300 " }; \n" 1299 " }; \n"
1301 "}; \n"; 1300 "}; \n";
1302 v8::Script::Compile(v8::String::New(script)); 1301 v8::Script::Compile(v8::String::New(script));
1303 CHECK(try_catch.HasCaught()); 1302 CHECK(try_catch.HasCaught());
1304 v8::String::Utf8Value exception(try_catch.Exception()); 1303 v8::String::Utf8Value exception(try_catch.Exception());
1305 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", 1304 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.",
1306 *exception); 1305 *exception);
1307 } 1306 }
OLDNEW
« test/cctest/test-mark-compact.cc ('K') | « test/cctest/test-mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698