]> git.lizzy.rs Git - rust.git/commit
Avoid overflow in step counter
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Wed, 27 Jun 2018 04:59:43 +0000 (21:59 -0700)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Wed, 4 Jul 2018 21:36:07 +0000 (14:36 -0700)
commitb3b04b8cc6fb66b89613b4b636182b5de53a0601
treec0d8c27d2099e210a6f487ce63e0cb2051247139
parent647ba29b90155e07cf569060d344242b3ee474eb
Avoid overflow in step counter

This removes the `usize` argument to `inc_step_counter`. Now, the step
counter increments by exactly one for every terminator evaluated. After
`STEPS_UNTIL_DETECTOR_ENABLED` steps elapse, the detector is run every
`DETECTOR_SNAPSHOT_PERIOD` steps. The step counter is only kept modulo
this period.
src/librustc_mir/interpret/eval_context.rs
src/librustc_mir/interpret/step.rs