From b9b0ab769f161ef11f9a06703519e02af9620521 Mon Sep 17 00:00:00 2001 From: inglorion Date: Sun, 30 Jul 2017 02:56:51 -0700 Subject: [PATCH] in blob_find_last_before, look at data, not blob ptr --- bootstrap/src/antimony/blob_sb.voo | 3 ++- src/antimony/blob_sb.sb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap/src/antimony/blob_sb.voo b/bootstrap/src/antimony/blob_sb.voo index 8b2f537..b145b1b 100644 --- a/bootstrap/src/antimony/blob_sb.voo +++ b/bootstrap/src/antimony/blob_sb.voo @@ -40,6 +40,7 @@ function sbJ_blob sbJ_byte sbJ_start # before the given index. If no occurrence is found, # returns -1. let sbJ_i sub sbJ_start 1 + let sbJ_data get-word sbJ_blob 2 block let _sb_G7 0 let sbJ_b 0 @@ -49,7 +50,7 @@ _sb_G8: ifeq _sb_G7 @sbJ_false goto _sb_G9 end if - set sbJ_b get-byte sbJ_blob sbJ_i + set sbJ_b get-byte sbJ_data sbJ_i let sbJ__sb_G6 call sbJ_ne sbJ_b sbJ_byte set _sb_G7 sbJ__sb_G6 ifeq _sb_G7 @sbJ_false diff --git a/src/antimony/blob_sb.sb b/src/antimony/blob_sb.sb index 93f741a..b7d4da0 100644 --- a/src/antimony/blob_sb.sb +++ b/src/antimony/blob_sb.sb @@ -24,11 +24,12 @@ function blob_find_last_before blob byte start { # before the given index. If no occurrence is found, # returns -1. var i = sub start 1 + var data = get-word blob 2 loop { var b = 0 do while (gt i -1) - set b get-byte blob i + set b get-byte data i while (ne b byte) set i sub i 1 } -- 2.11.4.GIT