about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2017-06-14 10:53:37 +0200
committerAjax <commial@gmail.com>2017-06-14 10:53:37 +0200
commitb6f3fe5c4d11c19d4375c07c1d73e5f644cd3272 (patch)
tree5636844f25dbf8fad61aa33bc18956a32b003b9d
parentb772f2d9c7aceb7d1ca87cdefd708d4f65d71623 (diff)
downloadmiasm-b6f3fe5c4d11c19d4375c07c1d73e5f644cd3272.tar.gz
miasm-b6f3fe5c4d11c19d4375c07c1d73e5f644cd3272.zip
Properly retrieve globals if it already exists
-rw-r--r--miasm2/jitter/llvmconvert.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/miasm2/jitter/llvmconvert.py b/miasm2/jitter/llvmconvert.py
index ae018c18..0aedebd3 100644
--- a/miasm2/jitter/llvmconvert.py
+++ b/miasm2/jitter/llvmconvert.py
@@ -512,7 +512,8 @@ class LLVMFunction():
 
         Get or create a (LLVM module-)global constant with *name* or *value*.
         """
-        module = self.mod
+        if name in self.mod.globals:
+            return self.mod.globals[name]
         data = llvm_ir.GlobalVariable(self.mod, value.type, name=name)
         data.global_constant = True
         data.initializer = value