]> granicus.if.org Git - llvm/commit
[JITLink] Make sure we explicitly deallocate memory on failure.
authorLang Hames <lhames@gmail.com>
Wed, 1 May 2019 02:43:52 +0000 (02:43 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 1 May 2019 02:43:52 +0000 (02:43 +0000)
commitb78c93233b7808bbf0054c02aec219f6cf43a88e
tree1de4c13fcc3f47ca1030309d15f985f846c95529
parentb404cbffb3a06ff700d7352f8fca74d8e46b9c8b
[JITLink] Make sure we explicitly deallocate memory on failure.

JITLinkGeneric phases 2 and 3 (focused on applying fixups and finalizing memory,
respectively) may fail for various reasons. If this happens, we need to
explicitly de-allocate the memory allocated in phase 1 (explicitly, because
deallocation may also fail and so is implemented as a method returning error).

No testcase yet: I am still trying to decide on the right way to test totally
platform agnostic code like this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359643 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
lib/ExecutionEngine/JITLink/JITLinkGeneric.h