85fcbde22f
CS eliminates outer expressions before inner ones, as `x * y * z` before `x * y`. It does this by reversing the order of expressions in the code. This almost always works, but it sometimes doesn't work if a STI changes the value number of a LOI. In code like `expr1 LOI expr2 STI expr2 LOI`, CS might eliminate the inner `expr2` before the outer `expr2 LOI`. This caused a read after free because the occurrence of `expr2 LOI` pointed to the eliminated lines of `expr2`. This bug went unnoticed until my recent changes caused CS to crash with a double free. I did not get the crash in OpenBSD, but I saw the crash in Travis, then David Given reproduced the crash in Linux. See the discussion in https://github.com/davidgiven/ack/pull/73 |
||
---|---|---|
.. | ||
cs.c | ||
cs.h | ||
cs_alloc.c | ||
cs_alloc.h | ||
cs_aux.c | ||
cs_aux.h | ||
cs_avail.c | ||
cs_avail.h | ||
cs_debug.c | ||
cs_debug.h | ||
cs_elim.c | ||
cs_elim.h | ||
cs_entity.c | ||
cs_entity.h | ||
cs_getent.c | ||
cs_getent.h | ||
cs_kill.c | ||
cs_kill.h | ||
cs_partit.c | ||
cs_partit.h | ||
cs_profit.c | ||
cs_profit.h | ||
cs_stack.c | ||
cs_stack.h | ||
cs_vnm.c | ||
cs_vnm.h |