xr0-org / xr0

The Xr0 Verifier for C
https://xr0.dev
Apache License 2.0
173 stars 4 forks source link

Surface invalid pointer dereferencing as user error #31

Closed claude-betz closed 5 months ago

claude-betz commented 6 months ago

Surface invalid dereferencing of types that are not pointers as user errors.

0v: src/0v/ast/type/type.c:358: ast_type_ptr_type: Assertion `t->base == TYPE_POINTER' failed.
==85470== 
==85470== Process terminating with default action of signal 6 (SIGABRT)
==85470==    at 0x4C9700B: raise (/build/glibc-wuryBv/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51)
==85470==    by 0x4C76858: abort (/build/glibc-wuryBv/glibc-2.31/stdlib/abort.c:79)
==85470==    by 0x4C76728: __assert_fail_base.cold (/build/glibc-wuryBv/glibc-2.31/assert/assert.c:92)
==85470==    by 0x4C87FD5: __assert_fail (/build/glibc-wuryBv/glibc-2.31/assert/assert.c:101)
==85470==    by 0x1157AB: ast_type_ptr_type (0v/ast/type/type.c:358)
==85470==    by 0x10E5A4: expr_unary_lvalue (0v/ast/expr/verify.c:180)
==85470==    by 0x10E417: ast_expr_lvalue (0v/ast/expr/verify.c:145)
==85470==    by 0x10FC1F: expr_assign_eval (0v/ast/expr/verify.c:766)
==85470==    by 0x10EB8E: ast_expr_eval (0v/ast/expr/verify.c:335)
==85470==    by 0x10E38A: ast_expr_exec (0v/ast/expr/verify.c:121)
==85470==    by 0x113BEB: ast_stmt_exec (0v/ast/stmt/verify.c:189)
==85470==    by 0x1135F3: ast_stmt_process (0v/ast/stmt/verify.c:31)
claude-betz commented 5 months ago

implemented as part of #32