From e658c9ccb41f14c026c97f0d93f5e9f000282cf3 Mon Sep 17 00:00:00 2001 From: Malinin Andrey Date: Thu, 1 Aug 2024 17:40:33 +0800 Subject: [PATCH] Static analyzer fix Issue: https://gitee.com/openharmony-sig/arkcompiler_ets_runtime/issues/IAF1PZ Tests: ninja all tests Signed-off-by: Malinin Andrey --- runtime/intrinsics-inl.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/runtime/intrinsics-inl.h b/runtime/intrinsics-inl.h index 752ca2daa..0d39064a9 100644 --- a/runtime/intrinsics-inl.h +++ b/runtime/intrinsics-inl.h @@ -538,6 +538,7 @@ INLINE_ECMA_INTRINSICS uint64_t DefinefuncDyn(JSThread *thread, uint64_t method, JSHandle lexenvHandle(thread, lexenv); auto res = SlowRuntimeStub::DefinefuncDyn(thread, result->GetCallTarget()); result = JSFunction::Cast(res.GetHeapObject()); + // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) auto constpool = ConstantPool::Cast(cp); // May not be moved by GC lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC result->SetConstantPool(thread, JSTaggedValue(constpool)); @@ -1372,8 +1373,9 @@ INLINE_ECMA_INTRINSICS uint64_t DefineNCFuncDyn(JSThread *thread, uint64_t metho return res.GetRawData(); } result = JSFunction::Cast(res.GetHeapObject()); - homeObj = homeObjHandle.GetTaggedValue(); // May be moved by GC - lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + homeObj = homeObjHandle.GetTaggedValue(); // May be moved by GC + lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) result->SetConstantPool(thread, JSTaggedValue(cp)); // ConstantPool is non-movable } result->SetLexicalEnv(thread, lexenv); @@ -1572,7 +1574,8 @@ INLINE_ECMA_INTRINSICS uint64_t DefineGeneratorFunc(JSThread *thread, uint64_t m return res.GetRawData(); } result = JSFunction::Cast(res.GetHeapObject()); - lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) result->SetConstantPool(thread, JSTaggedValue(cp)); // ConstantPool is non-movable } result->SetLexicalEnv(thread, lexenv); @@ -1630,7 +1633,8 @@ INLINE_ECMA_INTRINSICS uint64_t DefineAsyncFunc(JSThread *thread, uint64_t metho return res.GetRawData(); } result = JSFunction::Cast(res.GetHeapObject()); - lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) result->SetConstantPool(thread, JSTaggedValue(cp)); // ConstantPool is non-movable } result->SetLexicalEnv(thread, lexenv); @@ -1650,7 +1654,8 @@ INLINE_ECMA_INTRINSICS uint64_t DefineAsyncGeneratorFunc(JSThread *thread, uint6 return res.GetRawData(); } result = JSFunction::Cast(res.GetHeapObject()); - lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + lexenv = lexenvHandle.GetTaggedValue(); // May be moved by GC + // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) result->SetConstantPool(thread, JSTaggedValue(cp)); // ConstantPool is non-movable } result->SetLexicalEnv(thread, lexenv); @@ -2065,7 +2070,8 @@ INLINE_ECMA_INTRINSICS uint64_t DefineMethod(JSThread *thread, uint64_t method, return res.GetRawData(); } result = JSFunction::Cast(res.GetHeapObject()); - env = envHandle.GetTaggedValue(); // Maybe moved by GC + env = envHandle.GetTaggedValue(); // Maybe moved by GC + // SUPPRESS_CSA_NEXTLINE(alpha.core.WasteObjHeader) result->SetConstantPool(thread, JSTaggedValue(cp)); // ConstantPool is non-movable } else { result->SetHomeObject(thread, home); -- Gitee