fix(funcdef): @life/@willFree 从自定义行为装饰器检测中排除
P2 的编译期生命期标注没有运行时装饰器函数;不排除会生成 wrapper 去调用不存在的 @life/@willFree,并把被装饰的 extern def(stdlib.free)变成本模块 internal 声明。与 TPV 侧 FuncGenDef 同口径。
This commit is contained in:
1 parent
5a0eecc22f
commit
04acaa3dd5
1 file changed
+4
-1
@@ -1398,7 +1398,10 @@ class FunctionHandle(BaseHandle):
|
||||
# 任何 @name 或 @name(args) 只要不是内置装饰器,都视为自定义行为装饰器
|
||||
behavior_decorators = []
|
||||
# 内置装饰器名称,这些由编译器特殊处理,不作为行为装饰器
|
||||
_BUILTIN_DECORATORS = {'staticmethod', 'property', 'classmethod'}
|
||||
# 另含**编译期生命期标注**(P2):@life(willFree(...)) 与 @willFree(...) 是纯标注,
|
||||
# 没有运行时装饰器函数;不排除会生成 wrapper 去调用不存在的 @life/@willFree,
|
||||
# 并把被装饰的 extern def(如 stdlib.free)变成本模块 internal 声明(llc 报 linkage 错)。
|
||||
_BUILTIN_DECORATORS = {'staticmethod', 'property', 'classmethod', 'life', 'willFree'}
|
||||
_symtab: object = self.Trans.SymbolTable
|
||||
if Node.decorator_list:
|
||||
for decorator in Node.decorator_list:
|
||||
|
||||
Reference in new issue
Block a user