Fix wrong register calculation in AssignmentExpressionSimpleNode

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2024-03-19 19:15:13 +09:00 committed by Patrick Kim
commit 2bde2b91e3
3 changed files with 5 additions and 13 deletions

View file

@ -82,6 +82,7 @@ protected:
for (size_t i = 0; i < leftNames.size(); i++) {
if (leftNames[i] == name) {
isSlowMode = true;
break;
}
}
});
@ -95,15 +96,7 @@ protected:
AtomicString leftName = m_left->asIdentifier()->name();
bool result = false;
m_right->iterateChildren([&](Node* node) {
if (node->type() == ASTNodeType::UnaryExpressionDelete) {
UnaryExpressionDeleteNode* del = ((UnaryExpressionDeleteNode*)node);
if (del->argument()->isIdentifier()) {
if (leftName == del->argument()->asIdentifier()->name()) {
// x = delete x;
result = true;
}
}
} else if (node->type() == ASTNodeType::CallExpression) {
if (node->type() == ASTNodeType::CallExpression) {
CallExpressionNode* call = (CallExpressionNode*)node;
if (call->callee()->isIdentifier() && call->callee()->asIdentifier()->name().string()->equals("eval")) {
// x = (eval("var x;"), 1);

View file

@ -45,7 +45,6 @@ public:
isSlowMode = isSlowMode || isLeftBindingAffectedByRightExpression();
}
bool isBase = context->m_registerStack->size() == 0;
size_t rightRegister = dstRegister;
if (isSlowMode) {

View file

@ -326,10 +326,10 @@ private:
if (context->m_isWithScope) {
return true;
}
}
if (context->m_isLeftBindingAffectedByRightExpression) {
return true;
if (context->m_isLeftBindingAffectedByRightExpression) {
return true;
}
}
}
} else {