fix: correct argument order for store operations
Co-authored-by: aider (openrouter/deepseek/deepseek-v4-pro) <aider@aider.chat>
This commit is contained in:
+3
-3
@@ -402,8 +402,8 @@ void do_fetch(Word* w) {
|
||||
|
||||
void do_store(Word* w) {
|
||||
(void)w;
|
||||
int64_t val = data_pop();
|
||||
int64_t addr = data_pop();
|
||||
int64_t val = data_pop();
|
||||
if (addr < 0 || addr >= user_mem_size) {
|
||||
printf("Address out of bounds\n");
|
||||
return;
|
||||
@@ -413,8 +413,8 @@ void do_store(Word* w) {
|
||||
|
||||
void do_plus_store(Word* w) {
|
||||
(void)w;
|
||||
int64_t val = data_pop();
|
||||
int64_t addr = data_pop();
|
||||
int64_t val = data_pop();
|
||||
if (addr < 0 || addr >= user_mem_size) {
|
||||
printf("Address out of bounds\n");
|
||||
return;
|
||||
@@ -436,8 +436,8 @@ void do_cfetch(Word* w) {
|
||||
|
||||
void do_cstore(Word* w) {
|
||||
(void)w;
|
||||
int64_t val = data_pop();
|
||||
int64_t addr = data_pop();
|
||||
int64_t val = data_pop();
|
||||
int64_t max_byte = user_mem_size * (int64_t)sizeof(Cell);
|
||||
if (addr < 0 || addr >= max_byte) {
|
||||
printf("Address out of bounds\n");
|
||||
|
||||
Reference in New Issue
Block a user