1.1 --- a/encoders.py Thu Oct 27 17:55:28 2016 +0200
1.2 +++ b/encoders.py Fri Oct 28 14:06:54 2016 +0200
1.3 @@ -185,6 +185,10 @@
1.4 "__encode_callable",
1.5 )
1.6
1.7 +static_ops = (
1.8 + "__load_static",
1.9 + )
1.10 +
1.11 def encode_access_instruction(instruction, subs):
1.12
1.13 """
1.14 @@ -239,6 +243,11 @@
1.15 op = "__load_function"
1.16 a = [kind == "<class>" and encode_instantiator_pointer(origin) or encode_function_pointer(origin)]
1.17
1.18 + # Obtain addresses of static objects.
1.19 +
1.20 + elif op in static_ops:
1.21 + a[0] = "&%s" % a[0]
1.22 +
1.23 argstr = "(%s)" % ", ".join(a)
1.24
1.25 # Substitute the first element of the instruction, which may not be an