Opened 4 years ago

Closed 4 years ago

#36 closed defect (fixed)

constructor call, assertion failure

Reported by: pabuhr Owned by: Rob
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

struct S {
    size_t size;
};
void ?{}( S * s, int asize ) {}
int main() {
    x{}( 20 ); // assertion error
}

cfa test1.c
CFA Version 1.0.0 (debug)
*CFA assertion error* "false" from program "cfa-cpp" in "std::__cxx11::string InitTweak::{anonymous}::funcName(Expression*)" at line 436 in file "InitTweak/InitTweak.cc": Unexpected expression type being called as a function in call expression
Stack back trace for: /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp
(0) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp() [0x57f226]
(1) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : InitTweak::getFunctionName[abi:cxx11](Expression*)+0x46 [0x57ecb6]
(2) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::visit(UntypedExpr*)+0x108 [0x5b4078]
(3) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::find(Expression*, bool, bool)+0x44 [0x5b0594]
(4) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::visit(CastExpr*)+0xe1 [0x5b1cf1]
(5) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::AlternativeFinder::find(Expression*, bool, bool)+0x44 [0x5b0594]
(6) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::resolveInVoidContext(Expression*, SymTab::Indexer const&, ResolvExpr::TypeEnvironment&)+0x90 [0x5b1820]
(7) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::findVoidExpression(Expression*, SymTab::Indexer const&)+0x46 [0x5c4276]
(8) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::Resolver::visit(ExprStmt*)+0x1d [0x5c42dd]
(9) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : SymTab::Indexer::visit(CompoundStmt*)+0x52 [0x5d8d42]
(10) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : SymTab::Indexer::visit(FunctionDecl*)+0x7e [0x5d900e]
(11) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::Resolver::visit(FunctionDecl*)+0x4f [0x5c5def]
(12) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::resolve(std::__cxx11::list<Declaration*, std::allocator<Declaration*> >)+0x7a [0x5c43fa]
(13) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : main(/*unknown*/)+0x68c [0x4b24cc]
CFA Translator error: cfa-cpp failed with signal 6

Change History (1)

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

Resolution: fixed
Status: assignedclosed

In 19a9822:

Handle ConstructorExpr? in InitTweak::getFunctionName [fixes #36]

Note: See TracTickets for help on using tickets.