mirror of https://github.com/svaarala/duktape.git
Browse Source
Before the change a negative input offset would lead to memory unsafe behavior. This is correct as such because a negative input offset should never happen (so an assert is sufficient). However, the compiler saves and restores lexer "points" to and from duk_tval numbers, so if duk_tval representation is chosen improperly or something similar happens, the input offset could be corrupted (again, this is only the case if something is pretty badly wrong anyway). The new behavior is to throw an internal error for negative input offsets. This is explicit and memory safe, and protects against potential compiler bugs too.pull/20/head
Sami Vaarala
11 years ago
2 changed files with 30 additions and 13 deletions
Loading…
Reference in new issue