Skip to content

Failed overflow-checker assertion in C++ mode. #351

Open
@michael-emmi

Description

@michael-emmi

An assertion in IntegerOverflowChecker fails when compiling in C++ mode:

$ cat a.cpp && smack a.cpp --clang-options="-x c++ -std=c++14"

#include <smack.h>

int main() {
	return 0;
}
SMACK program verifier version 1.9.0
Assertion failed: (co != NULL && "Function __SMACK_check_overflow should be present."), function runOnModule, file /Users/mje/Code/smack/lib/smack/IntegerOverflowChecker.cpp, line 113.
Stack dump:
0.	Program arguments: llvm2bpl /Users/mje/Code/smack/b-gxo6nc.bc -bpl /Users/mje/Code/smack/a-p5MCD_.bpl -warnings -source-loc-syms -entry-points main -mem-mod-impls 
1.	Running pass 'Checked integer arithmetic intrinsics' on module '/Users/mje/Code/smack/b-gxo6nc.bc'.
Traceback (most recent call last):
  File "/usr/local/bin/smack", line 13, in <module>
    smack.top.main()
  File "/usr/local/bin/../share/smack/top.py", line 769, in main
    frontend(args)
  File "/usr/local/bin/../share/smack/top.py", line 285, in frontend
    return frontends()[lang](args)
  File "/usr/local/bin/../share/smack/top.py", line 362, in clang_plusplus_frontend
    default_link_bc_files(compile_command, args)
  File "/usr/local/bin/../share/smack/top.py", line 448, in default_link_bc_files
    llvm_to_bpl(args)
  File "/usr/local/bin/../share/smack/top.py", line 499, in llvm_to_bpl
    try_command(cmd, console=True)
  File "/usr/local/bin/../share/smack/utils.py", line 69, in try_command
    raise Exception(output)
Exception: Assertion failed: (co != NULL && "Function __SMACK_check_overflow should be present."), function runOnModule, file /Users/mje/Code/smack/lib/smack/IntegerOverflowChecker.cpp, line 113.
Stack dump:
0.	Program arguments: llvm2bpl /Users/mje/Code/smack/b-gxo6nc.bc -bpl /Users/mje/Code/smack/a-p5MCD_.bpl -warnings -source-loc-syms -entry-points main -mem-mod-impls 
1.	Running pass 'Checked integer arithmetic intrinsics' on module '/Users/mje/Code/smack/b-gxo6nc.bc'.

This is a simplified version of michael-emmi/ctverif#2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions