more bug fixes

This commit is contained in:
Daniella / Tove 2022-05-04 04:27:44 +02:00
parent 81eff27575
commit bec43212c1
2 changed files with 21 additions and 5 deletions

View file

@ -132,6 +132,13 @@ public class ISBPL {
throw error;
}
} catch (Exception e) {
if(stack.size() > stackHeight) {
stack.setSize(stackHeight);
stack.trimToSize();
}
while(stack.size() < stackHeight) {
stack.push(getNullObject());
}
if (Arrays.asList(allowed).contains("Java") || allowed.length == 1 && allowed[0].equals("all")) {
stack.push(toISBPL(e));
stack.push(toISBPLString(e.getClass().getName()));

View file

@ -38,6 +38,7 @@ native subprocess
"index has to be <16, index 0 is this call" #
native _last_word
native include
native reload
native putchar
native mktype
native mkinstance
@ -310,15 +311,22 @@ func strjoin {
s
}
func strsub {
func strsub {
def pos2 _int =pos2
def pos1 _int =pos1
_array
pos1 pos2 asub _string
}
func asub {
"bind args" #
def pos2 _int =pos2
def pos1 _int =pos1
def string _string =string
def arr =arr
pos2 pos1 - =length
def length pos2 pos1 - =length
( o _char length anew dup ) string swap pos1 0 length acopy
arr length anew pos1 0 length acopy
}
func puts {
@ -444,7 +452,8 @@ func [ {
TYPE_ARRAY TYPE_SHADOW settype
}
"For some reason, this makes objects lose their identity, because of the DUP statement. I do not know, why." #
"For some reason, this makes objects lose their identity. I do not know, why." #
"Fixed in commit 81eff27, bug was in dup native." #
func ] {
"create an array containing everything on stack until the arrayshadow" #
def array 0 anew =array