Skip to content

Instantly share code, notes, and snippets.

@mraleph
Created November 9, 2011 19:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mraleph/1352731 to your computer and use it in GitHub Desktop.
Save mraleph/1352731 to your computer and use it in GitHub Desktop.
catching memory corruption
static Handle<Value> Stat(const Arguments& args) {
HandleScope scope;
if (args.Length() < 1 || !args[0]->IsString()) {
return THROW_BAD_ARGS;
}
String::Utf8Value path(args[0]->ToString());
if (args[1]->IsFunction()) {
ASYNC_CALL(stat, args[1], *path)
} else {
printf("isolate_ before call to uv: %p\n", *((void**)&scope));
SYNC_CALL(stat, *path, *path)
printf("isolate_ after call to uv: %p\n", *((void**)&scope));
return scope.Close(BuildStatsObject((NODE_STAT_STRUCT*)SYNC_REQ.ptr));
}
}
@mraleph
Copy link
Author

mraleph commented Nov 9, 2011

isolate_ before call to uv: 0x101026800
isolate_ after call to uv: 0x0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment