fix: add defensive checks in excel formula evaluation#46
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Nov 10, 2025
Merged
fix: add defensive checks in excel formula evaluation#46deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
1. Added null check for targetName.m_stack before accessing first element to prevent potential crashes 2. Added error handling when stack is empty by returning oERR operand and setting error flag 3. Improved exception handling by ensuring name.m_stack is never empty after exceptions 4. Added proper error state flags (m_hasError) when errors occur Log: Fixed potential crashes in Excel formula evaluation with invalid references Influence: 1. Test formulas referencing non-existent names or invalid references 2. Verify error handling when formula stack becomes empty 3. Test exception scenarios to confirm proper error state is maintained 4. Verify calculations continue normally when references are valid fix: 在Excel公式计算中添加防御性检查 1. 在访问第一个元素前添加对 targetName.m_stack 的空检查以防止潜在崩溃 2. 当栈为空时通过返回 oERR 操作数并设置错误标志添加错误处理 3. 通过确保异常后 name.m_stack 不会为空来改进异常处理 4. 发生错误时添加正确的错误状态标志(m_hasError) Log: 修复了引用无效对象时Excel公式计算可能崩溃的问题 Influence: 1. 测试引用不存在名称或无效引用的公式 2. 验证当公式栈为空时的错误处理 3. 测试异常场景以确认正确的错误状态被维护 4. 当引用有效时验证计算是否正常继续
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review我来对这段代码的修改进行审查:
改进建议:
void handleError(Name& name) {
if (name.m_stack.empty()) {
name.m_stack.push_back(Operand(oERR));
}
name.m_hasError = true;
name.m_evaluated = true;
}
总体来说,这是一个很好的改进,提高了代码的健壮性和安全性,同时保持了良好的性能。建议的改进主要是为了提高代码的可维护性和可读性。 |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: Fixed potential crashes in Excel formula evaluation with invalid references
Influence:
fix: 在Excel公式计算中添加防御性检查
Log: 修复了引用无效对象时Excel公式计算可能崩溃的问题
Influence: