add expect call to ensure tryAllocateExecutable actually succeeds

For some reason, running Avian under the SVN version of Valgrind
caused mmap to fail, which caused tryAllocateExecutable to return a
null pointer, which led to a non-obvious crash later on.  Adding an
expect to check the result immediately will at least make it obvious
what went wrong.
This commit is contained in:
Joel Dice 2014-04-11 19:52:53 -06:00
parent f7614bf8a7
commit 1b8b27fb6b

View File

@ -9095,6 +9095,9 @@ class MyProcessor: public Processor {
if (codeAllocator.memory.begin() == 0) {
codeAllocator.memory.items = static_cast<uint8_t*>(
s->tryAllocateExecutable(ExecutableAreaSizeInBytes));
expect(t, codeAllocator.memory.items);
codeAllocator.memory.count = ExecutableAreaSizeInBytes;
}
#endif