Opened 3 years ago

Closed 3 years ago

#77 closed defect (fixed)

Assertion failure in initialization of enum

Reported by: Rob Schluntz Owned by: Rob Schluntz
Priority: trivial Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

int main() {
   enum C { R, G, B };
   enum C c;
   c = (enum C){ R };
}

cfa test.c
CFA Version 1.0.0 (debug)
*CFA assertion error* "dynamic_cast< TypeInstType * >( type )" from program "cfa-cpp" in "ResolvExpr::MemberIterator* ResolvExpr::createMemberIterator(Type*)" at line 445 in file "ResolvExpr/CurrentObject.cc": some other reftotype
Stack back trace for: /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp
(0) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::createMemberIterator(Type*)+0x2b6 [0x9cbd36]
(1) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::CurrentObject::enterListInit()+0x3f [0x9cbecf]
(2) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::Resolver::previsit(ListInit*)+0x4e [0x97d8de]
(3) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(ListInit*)+0x53 [0x9838a3]
(4) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(ObjectDecl*)+0xf5 [0x988085]
(5) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(DeclStmt*)+0x58 [0x982c88]
(6) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : void PassVisitor<ResolvExpr::Resolver>::handleStatementList<PassVisitor<ResolvExpr::Resolver>::visitStatementList(std::__cxx11::list<Statement*, std::allocator<Statement*> >&)::{lambda(Statement*)#1}>(std::__cxx11::list<Statement*, std::allocator<Statement*> >&, PassVisitor<ResolvExpr::Resolver>::visitStatementList(std::__cxx11::list<Statement*, std::allocator<Statement*> >&)::{lambda(Statement*)#1})+0x1af [0x98c8ff]
(7) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(CompoundStmt*)+0x61 [0x98ccd1]
(8) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(FunctionDecl*)+0x1d4 [0x98d584]
(9) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::resolve(std::__cxx11::list<Declaration*, std::allocator<Declaration*> >)+0x111 [0x981821]
(10) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : main(/*unknown*/)+0x675 [0x5f6485]
CFA Translator error: cfa-cpp failed with signal 6

Change History (1)

comment:1 Changed 3 years ago by Rob Schluntz <rschlunt@…>

Resolution: fixed
Status: assignedclosed

In 78754d7:

Fix assertion failure in CurrentObject? [fixes #77]

Note: See TracTickets for help on using tickets.