Opened 4 years ago

Closed 4 years ago

#76 closed defect (fixed)

VLA array and operator ?<?

Reported by: pabuhr Owned by: Rob Schluntz <rschlunt@…>
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

Operator ?<? causes the code to fail.

_Bool ?+?( _Bool lhs, _Bool rhs ) { return 2; }
_Bool ?<?( _Bool lhs, _Bool rhs ) { return 3; } // comment out and it works

int main() {
    const int Bops = 1;
    _Bool (* opr[Bops])( _Bool, _Bool ) = { ?+? };
}

cfa test1.c
CFA Version 1.0.0 (debug)
*CFA assertion error* "finder.get_alternatives().size() == 1" from program "cfa-cpp" in "void ResolvExpr::findSingleExpression(Expression*&, const SymTab::Indexer&)" at line 157 in file "ResolvExpr/Resolver.cc": findSingleExpression: must have exactly one alternative at the end.
Stack back trace for: /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp
(0) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::findSingleExpression(Expression*&, SymTab::Indexer const&)+0x144 [0x91ea54]
(1) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(IfStmt*)+0x56 [0x92ce46]
(2) /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 [0x92d0bf]
(3) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(CompoundStmt*)+0x61 [0x92d491]
(4) /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 [0x92d0bf]
(5) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(CompoundStmt*)+0x61 [0x92d491]
(6) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(ImplicitCtorDtorStmt*)+0x58 [0x923538]
(7) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::Resolver::previsit(ConstructorInit*)+0x26 [0x91e306]
(8) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(ConstructorInit*)+0x53 [0x924163]
(9) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(ObjectDecl*)+0xf5 [0x928845]
(10) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(DeclStmt*)+0x58 [0x923478]
(11) /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 [0x92d0bf]
(12) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(CompoundStmt*)+0x61 [0x92d491]
(13) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : PassVisitor<ResolvExpr::Resolver>::visit(FunctionDecl*)+0x1d4 [0x92dd44]
(14) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : ResolvExpr::resolve(std::__cxx11::list<Declaration*, std::allocator<Declaration*> >)+0x111 [0x921fd1]
(15) /u/pabuhr/software/cfa-cc/lib/cfa/cfa-cpp : main(/*unknown*/)+0x675 [0x5d1585]
CFA Translator error: cfa-cpp failed with signal 6

Change History (1)

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

Owner: set to Rob Schluntz <rschlunt@…>
Resolution: fixed
Status: newclosed

In 8587878:

Refactor findIntegralExpression and use it to resolve if/for/while conditions [fixes #76]

Note: See TracTickets for help on using tickets.