Added support for LOAD_CLASSDEREF
The opcode itself is exactly the same as `LOAD_DEREF` 1) The problem is when the class is a closure (e.g. defined inside a function body) then there is a `BUILD_TUPLE` after the `LOAD_BUILD_CLASS` which makes problems. 2) There is another problem which makes the `code->name()` of the class to be part of the function locals. (e.g. `func.<locals>.my_class` instead of `my_class`) which makes the check `srcString->isEqual(code->name().cast<PycObject>())` be invalid.
This commit is contained in:
4
tests/input/load_classderef.py
Normal file
4
tests/input/load_classderef.py
Normal file
@@ -0,0 +1,4 @@
|
||||
def func():
|
||||
x = 1
|
||||
class my_class:
|
||||
y = x
|
Reference in New Issue
Block a user