Fix stack iteration stop condition

master
LemonBoy 2019-10-13 17:37:04 +02:00 committed by Andrew Kelley
parent 9439bf3809
commit b164e0ae55
1 changed files with 3 additions and 3 deletions

View File

@ -290,12 +290,12 @@ pub const StackIterator = struct {
0;
fn next(self: *StackIterator) ?usize {
if (self.fp < fp_adjust_factor) return null;
if (self.fp <= fp_adjust_factor) return null;
self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*;
if (self.fp < fp_adjust_factor) return null;
if (self.fp <= fp_adjust_factor) return null;
if (self.first_addr) |addr| {
while (self.fp >= fp_adjust_factor) : (self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*) {
while (self.fp > fp_adjust_factor) : (self.fp = @intToPtr(*const usize, self.fp - fp_adjust_factor).*) {
const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*;
if (addr == return_address) {
self.first_addr = null;