Fix lint errors, fix Windows version.

Sorry for not testing these prior to committing.

TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/115566


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2015 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 59fab02e
......@@ -131,7 +131,7 @@ static bool Consume(const char* str, char** buf) {
static void ParseAddress(char* start, Address* min_addr, Address* max_addr) {
Address addr = reinterpret_cast<Address>(strtoll(start, NULL, 16));
Address addr = reinterpret_cast<Address>(strtoul(start, NULL, 16)); // NOLINT
if (addr < *min_addr) *min_addr = addr;
if (addr > *max_addr) *max_addr = addr;
}
......@@ -140,7 +140,8 @@ static void ParseAddress(char* start, Address* min_addr, Address* max_addr) {
static Address ConsumeAddress(
char** start, Address min_addr, Address max_addr) {
char* end_ptr;
Address addr = reinterpret_cast<Address>(strtoll(*start, &end_ptr, 16));
Address addr =
reinterpret_cast<Address>(strtoul(*start, &end_ptr, 16)); // NOLINT
CHECK_GE(addr, min_addr);
CHECK_GE(max_addr, addr);
*start = end_ptr;
......@@ -162,7 +163,7 @@ class ParseLogResult {
: min_addr(reinterpret_cast<Address>(-1)),
max_addr(reinterpret_cast<Address>(0)),
entities_map(NULL), entities(NULL),
max_entities(0) {};
max_entities(0) {}
~ParseLogResult() {
// See allocation code below.
......@@ -377,6 +378,16 @@ static bool AreFuncNamesEqual(CodeEntityInfo ref_s, CodeEntityInfo new_s) {
&& IsStringEqualTo(error_prototype, new_s)) {
return true;
}
// Built-in objects have problems too.
const char* built_ins[] = {
"\"Boolean\"", "\"Function\"", "\"Number\"",
"\"Object\"", "\"Script\"", "\"String\""
};
for (size_t i = 0; i < sizeof(built_ins) / sizeof(*built_ins); ++i) {
if (IsStringEqualTo(built_ins[i], new_s)) {
return true;
}
}
return ref_len == new_len && strncmp(ref_s, new_s, ref_len) == 0;
}
......@@ -410,21 +421,22 @@ TEST(EquivalenceOfLoggingAndTraversal) {
i::FLAG_always_compact = true;
}
v8::Persistent<v8::Context> env = v8::Context::New();
v8::HandleScope scope;
v8::Handle<v8::Value> global_object = v8::Handle<v8::Value>();
v8::Persistent<v8::Context> env = v8::Context::New(
0, v8::Handle<v8::ObjectTemplate>(), global_object);
env->Enter();
// Compile and run a function that creates other functions.
v8::Script::Compile(v8::String::New(
"(function f() {\n"
" var rets = [];\n"
" for (var i = 0; i < 100; ++i) {\n"
" rets.push((function inc(n) { return n + 1; })(i));\n"
" }\n"
"})();"))->Run();
v8::Local<v8::Script> script = v8::Script::Compile(v8::String::New(
"(function f(obj) {\n"
" obj.test =\n"
" (function a(j) { return function b() { return j; } })(100);\n"
"})(this);"));
script->Run();
i::Heap::CollectAllGarbage();
i::EmbeddedVector<char,204800> buffer;
i::EmbeddedVector<char, 204800> buffer;
int log_size;
ParseLogResult ref_result;
......@@ -477,6 +489,8 @@ TEST(EquivalenceOfLoggingAndTraversal) {
ref_idx += ref_inc;
new_idx += new_inc;
}
// Make sure that all log data is written prior crash due to CHECK failure.
fflush(stdout);
CHECK(results_equal);
env->Exit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment