mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
Desciption: Deal with the "use after free" error
occurs while debugging ark_js_vm executable on windows. Details: Enclose the part where the LocalScope object should take effect with a pair of braces. Thus, the destructor of the LocalScope object will be called at the right brace which is above the JSNApi::DestroyJSVM() function. Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5C7XG Signed-off-by: Gongyuhang <gongyuhang5@huawei.com>
This commit is contained in:
parent
43e0608f7d
commit
496687fe52
@ -110,6 +110,7 @@ int Main(const int argc, const char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
LocalScope scope(vm);
|
||||
std::string entry = entrypoint.GetValue();
|
||||
arg_list_t pandaFileNames = files.GetValue();
|
||||
@ -133,6 +134,8 @@ int Main(const int argc, const char **argv)
|
||||
}
|
||||
generator.SaveAOTFile(outputFileName);
|
||||
generator.GenerateSnapshotFile();
|
||||
}
|
||||
|
||||
JSNApi::DestroyJSVM(vm);
|
||||
paParser.DisableTail();
|
||||
return ret ? 0 : -1;
|
||||
|
@ -109,6 +109,7 @@ int Main(const int argc, const char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
LocalScope scope(vm);
|
||||
std::string entry = entrypoint.GetValue();
|
||||
|
||||
@ -121,6 +122,7 @@ int Main(const int argc, const char **argv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSNApi::DestroyJSVM(vm);
|
||||
paParser.DisableTail();
|
||||
|
Loading…
Reference in New Issue
Block a user