ROSE crashes when object declared in 'switch' selector, with typecast operator to bool or enumeration in its class
@pinnown is already working on this.
Since Feb 18, 2020.
- Dominant language
- C
- Stars
- 688
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
One reproducer:
```cpp
enum Color { RED, GREEN, BLUE };
class A {
public:
operator Color() {
return RED;
}
};
void k()
{
A a;
switch (A a2 = a) {
case RED: a2;
}
}
```
```
assertion failed:
/export/tmp.rose-mgr/jenkins/edg4x/workspace/development-edg-binary-RMC/COMPILER/gcc-4.8.4-default/EDGVERSION/4.9/src/frontend/CxxFrontend/EDG/edgRose/edgRose.C:9577
SgStatement* EDG_ROSE_Translation::convert_condition(an_expr_node_ptr, SourceSequenceList&, a_statement_ptr)
required: lhs != __null
Print backtrace:
/rose/lib/librose.so.0(+0x2a29ce9)[0x7f72f5f07ce9]
/rose/lib/librose.so.0(_ZN6Sawyer6Assert4failEPKcS2_RKSsS2_jS2_+0xf5)[0x7f72f5f1df05]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation17convert_conditionEP12an_expr_nodeR18SourceSequenceListP11a_statement+0xb95)[0x7f72f58f216d]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation15parse_statementER18SourceSequenceListP12SgBasicBlock+0xaf0)[0x7f72f59851ac]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation20parse_statement_listER18SourceSequenceList16an_il_entry_kindPv+0x5d5)[0x7f72f5990ef2]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation15parse_statementER18SourceSequenceListP12SgBasicBlock+0x21bf)[0x7f72f598687b]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation19parse_function_bodyI21SgFunctionDeclarationEEvRK18SourceSequenceListP9a_routinePT_+0x1735)[0x7f72f59dbe89]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation15convert_routineEP9a_routinebP10a_templateP21SgFunctionDeclaration+0x10fae)[0x7f72f595c289]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation13parse_routineER18SourceSequenceListbP10a_templateb+0x151)[0x7f72f5947ea5]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation38parse_global_or_namespace_scope_entityER18SourceSequenceList+0x197)[0x7f72f59bb086]
/rose/lib/librose.so.0(_ZN20EDG_ROSE_Translation18parse_global_scopeEP8SgGlobalR18SourceSequenceListb+0x60b)[0x7f72f59be468]
/rose/lib/librose.so.0(_Z13sage_back_endR12SgSourceFile+0x4d6)[0x7f72f59bfca0]
/rose/lib/librose.so.0(_Z8cfe_mainiPPcR12SgSourceFile+0x1b7)[0x7f72f59c0ae3]
/rose/lib/librose.so.0(_Z8edg_mainiPPcR12SgSourceFile+0x45)[0x7f72f59c0c40]
/rose/lib/librose.so.0(_ZN12SgSourceFile19build_C_and_Cxx_ASTESt6vectorISsSaISsEES2_+0x18f)[0x7f72f436cfbf]
/rose/lib/librose.so.0(_ZN12SgSourceFile8buildASTESt6vectorISsSaISsEES2_+0x248)[0x7f72f436de28]
/rose/lib/librose.so.0(_ZN6SgFile12callFrontEndEv+0x5f7)[0x7f72f43753a7]
/rose/lib/librose.so.0(_ZN12SgSourceFile12callFrontEndEv+0xe)[0x7f72f437555e]
/rose/lib/librose.so.0(_ZN6SgFile11runFrontendERi+0x4c)[0x7f72f436a3bc]
/rose/lib/librose.so.0(_ZN4Rose8Frontend9RunSerialEP9SgProject+0xa8)[0x7f72f436e018]
/rose/lib/librose.so.0(_ZN4Rose8Frontend3RunEP9SgProject+0x1f)[0x7f72f436e2cf]
/rose/lib/librose.so.0(_ZN9SgProject11RunFrontendEv+0x56)[0x7f72f4372b16]
/rose/lib/librose.so.0(_ZN9SgProject5parseEv+0x28b)[0x7f72f437740b]
/rose/lib/librose.so.0(_ZN9SgProject5parseERKSt6vectorISsSaISsEE+0x27a)[0x7f72f437843a]
/rose/lib/librose.so.0(_ZN9SgProjectC1ERKSt6vectorISsSaISsEEb+0x340)[0x7f72f457a120]
/rose/lib/librose.so.0(_Z8frontendRKSt6vectorISsSaISsEEb+0x127)[0x7f72f5ef45a7]
/rose/lib/librose.so.0(_Z8frontendiPPcb+0x95)[0x7f72f5ef4825]
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.