From fd4941642f2714b3ff572fc0a18a6edaf3d2d599 Mon Sep 17 00:00:00 2001 From: Sergey Khil Date: Fri, 12 Jul 2024 17:07:29 +0300 Subject: [PATCH] fix segfault of inheritance props Signed-off-by: Sergey Khil --- ets2panda/checker/ets/object.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ets2panda/checker/ets/object.cpp b/ets2panda/checker/ets/object.cpp index c0eed917de..f4bbde8178 100644 --- a/ets2panda/checker/ets/object.cpp +++ b/ets2panda/checker/ets/object.cpp @@ -762,7 +762,6 @@ void ETSChecker::CollectImplementedMethodsFromInterfaces(ETSObjectType *classTyp while (index < collectedInterfaces.size()) { for (auto &it : abstractsToBeImplemented) { for (const auto &prop : collectedInterfaces[index]->Methods()) { - GetTypeOfVariable(prop); AddImplementedSignature(implementedSignatures, prop, it); } } @@ -2011,7 +2010,10 @@ void ETSChecker::TransformProperties(ETSObjectType *classType) LogTypeError("Interface property implementation cannot be generated as non-public", field->Declaration()->Node()->Start()); } - classType->RemoveProperty(field); + if (field->HasFlag(varbinder::VariableFlags::PROPERTY) && + field->HasFlag(varbinder::VariableFlags::INITIALIZED)) { + classType->RemoveProperty(field); + } GenerateGetterSetterPropertyAndMethod(originalProp, classType); } -- Gitee