-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consteval + modules + NSDMI => Assertion failure: "consteval function should never be emitted" #60275
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
clang:modules
C++20 modules and Clang Header Modules
crash
Prefer [crash-on-valid] or [crash-on-invalid]
Comments
@llvm/issue-subscribers-clang-codegen |
@llvm/issue-subscribers-clang-modules |
The backtrace looks very similar to #60085 |
CC @ChuanqiXu9 |
@llvm/issue-subscribers-clang-frontend |
CarlosAlbertoEnciso
pushed a commit
to SNSystems/llvm-debuginfo-analyzer
that referenced
this issue
Feb 3, 2023
…body during parsing Close llvm/llvm-project#60275 The root cause of issue 60275 is the imbalance of PushExpressionEvaluationContext() and PopExpressionEvaluationContext(). See https://github.com/llvm/llvm-project/blob/f1c4f927f7c15b5efdc3589c050fd0513bf6b303/clang/lib/Parse/Parser.cpp#L1396-L1437 We will PushExpressionEvaluationContext() in ActOnStartOfFunctionDef() in line 1396 and we should pop it in ActOnFinishFunctionBody later. However if we skip the function body in line 1402, the expression evaluation context will not be popped. Then here is the issue report. I fix the issue by inserting codes to pop the expression evaluation context explicitly if the function body is skipped. Maybe this looks like an ad-hoc fix. But if we want to fix this in a pretty way, we should refactor the current framework for pushing and popping expression evaluation contexts. Currently there are 23 PushExpressionEvaluationContext() callsities and 21 PopExpressionEvaluationContext() callsites in the code. And it seems not easy to balance them well and fast. So I suggest to land this fix first. At least it can prevent the crash. Reviewed By: cor3ntin Differential Revision: https://reviews.llvm.org/D143053
skatrak
pushed a commit
to skatrak/llvm-project-rocm
that referenced
this issue
Feb 10, 2023
…body during parsing Close llvm/llvm-project#60275 The root cause of issue 60275 is the imbalance of PushExpressionEvaluationContext() and PopExpressionEvaluationContext(). See https://github.com/llvm/llvm-project/blob/f1c4f927f7c15b5efdc3589c050fd0513bf6b303/clang/lib/Parse/Parser.cpp#L1396-L1437 We will PushExpressionEvaluationContext() in ActOnStartOfFunctionDef() in line 1396 and we should pop it in ActOnFinishFunctionBody later. However if we skip the function body in line 1402, the expression evaluation context will not be popped. Then here is the issue report. I fix the issue by inserting codes to pop the expression evaluation context explicitly if the function body is skipped. Maybe this looks like an ad-hoc fix. But if we want to fix this in a pretty way, we should refactor the current framework for pushing and popping expression evaluation contexts. Currently there are 23 PushExpressionEvaluationContext() callsities and 21 PopExpressionEvaluationContext() callsites in the code. And it seems not easy to balance them well and fast. So I suggest to land this fix first. At least it can prevent the crash. Reviewed By: cor3ntin Differential Revision: https://reviews.llvm.org/D143053
veselypeta
pushed a commit
to veselypeta/cherillvm
that referenced
this issue
Aug 8, 2024
…body during parsing Close llvm/llvm-project#60275 The root cause of issue 60275 is the imbalance of PushExpressionEvaluationContext() and PopExpressionEvaluationContext(). See https://github.com/llvm/llvm-project/blob/f1c4f927f7c15b5efdc3589c050fd0513bf6b303/clang/lib/Parse/Parser.cpp#L1396-L1437 We will PushExpressionEvaluationContext() in ActOnStartOfFunctionDef() in line 1396 and we should pop it in ActOnFinishFunctionBody later. However if we skip the function body in line 1402, the expression evaluation context will not be popped. Then here is the issue report. I fix the issue by inserting codes to pop the expression evaluation context explicitly if the function body is skipped. Maybe this looks like an ad-hoc fix. But if we want to fix this in a pretty way, we should refactor the current framework for pushing and popping expression evaluation contexts. Currently there are 23 PushExpressionEvaluationContext() callsities and 21 PopExpressionEvaluationContext() callsites in the code. And it seems not easy to balance them well and fast. So I suggest to land this fix first. At least it can prevent the crash. Reviewed By: cor3ntin Differential Revision: https://reviews.llvm.org/D143053
veselypeta
pushed a commit
to veselypeta/cherillvm
that referenced
this issue
Aug 14, 2024
…body during parsing Close llvm/llvm-project#60275 The root cause of issue 60275 is the imbalance of PushExpressionEvaluationContext() and PopExpressionEvaluationContext(). See https://github.com/llvm/llvm-project/blob/f1c4f927f7c15b5efdc3589c050fd0513bf6b303/clang/lib/Parse/Parser.cpp#L1396-L1437 We will PushExpressionEvaluationContext() in ActOnStartOfFunctionDef() in line 1396 and we should pop it in ActOnFinishFunctionBody later. However if we skip the function body in line 1402, the expression evaluation context will not be popped. Then here is the issue report. I fix the issue by inserting codes to pop the expression evaluation context explicitly if the function body is skipped. Maybe this looks like an ad-hoc fix. But if we want to fix this in a pretty way, we should refactor the current framework for pushing and popping expression evaluation contexts. Currently there are 23 PushExpressionEvaluationContext() callsities and 21 PopExpressionEvaluationContext() callsites in the code. And it seems not easy to balance them well and fast. So I suggest to land this fix first. At least it can prevent the crash. Reviewed By: cor3ntin Differential Revision: https://reviews.llvm.org/D143053
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
clang:modules
C++20 modules and Clang Header Modules
crash
Prefer [crash-on-valid] or [crash-on-invalid]
Given the following two source files:
and compiling with
causes Clang to crash with
The text was updated successfully, but these errors were encountered: