From 3249138bf4fa2524154e2c83da32874cfeaf7ea2 Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Thu, 13 May 2021 20:07:16 -0700 Subject: [PATCH] Implement SH_REF_LOCAL_ASSIGN_STRUCTREF2 Used in Haruka VS Escalayer --- src/vm.c | 9 ++++++++- subprojects/libsys4 | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vm.c b/src/vm.c index 32f4214..125aed5 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1899,6 +1899,13 @@ static enum opcode execute_instruction(enum opcode opcode) stack_push_string(string_ref(s)); break; } + case SH_REF_LOCAL_ASSIGN_STRUCTREF2: { + struct page *memb = heap_get_page(member_get(get_argument(0)).i); + int page = local_get(get_argument(1)).i; + int var = local_get(get_argument(1) + 1).i; + page_set_var(heap_get_page(page), var, page_get_var(memb, get_argument(2))); + break; + } case SH_GLOBAL_S_REF: { int str = global_get(get_argument(0)).i; stack_push_string(string_ref(heap_get_string(str))); @@ -1923,7 +1930,7 @@ static enum opcode execute_instruction(enum opcode opcode) } case SH_S_ASSIGN_CALLSYS19: { struct string *name = get_func_stack_name(stack_pop().i); - heap_string_assign(stack_pop_var()->i, name); + heap_string_assign(stack_pop().i, name); break; } case SH_S_ASSIGN_STR0: { diff --git a/subprojects/libsys4 b/subprojects/libsys4 index 6589929..ea9e1ec 160000 --- a/subprojects/libsys4 +++ b/subprojects/libsys4 @@ -1 +1 @@ -Subproject commit 6589929d2b09a7731f7ac862695b3b6df7c2f227 +Subproject commit ea9e1ec5cd041a60af58a53b22054b50a5abb68c