Bug (kind of) in 'isinstack' · lua/lua@e0260eb · GitHub
Skip to content

Commit e0260eb

Browse files
committed
Bug (kind of) in 'isinstack'
The function 'isinstack' tried to work around the undefined behavior of subtracting two pointers that do not point to the same object, but the compiler killed to trick. (It optimizes out the safety check, because in a correct execution it will be always true.)
1 parent 5205f07 commit e0260eb

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎ldebug.c‎

Lines changed: 10 additions & 6 deletions

‎testes/errors.lua‎

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)