Skip to content

Commit

Permalink
Fix complex assign
Browse files Browse the repository at this point in the history
  • Loading branch information
fikovnik committed Nov 13, 2024
1 parent 2c75dba commit 1f51b19
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TOOLS_DIR := $(BASE_DIR)/tools

.PHONY: setup
setup:
$(MAKE) -C external
$(MAKE) -C external setup
$(MAKE) -C client setup

.PHONY: setup-git
Expand Down
1 change: 0 additions & 1 deletion client/rsh/src/bc2c/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// MAKE SURE Rinternals.h is not listed!
#include "R_ext/Boolean.h"
#include "runtime_internals.h"
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/org/prlprg/bc2c/BC2CCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ private void compile(BcInstr instr, int pc) {
}
case BcInstr.Dup() -> {
stack.push();
yield "%s = %s;".formatted(stack.get(0), stack.get(-2));
yield "%s = %s;".formatted(stack.get(0), stack.get(-1));
}
case BcInstr.Dup2nd() -> {
stack.push();
yield "%s = %s;".formatted(stack.get(0), stack.get(-3));
yield "%s = %s;".formatted(stack.get(0), stack.get(-2));
}
default -> {
if (instr.label().orElse(null) instanceof BcLabel l) {
Expand Down
3 changes: 2 additions & 1 deletion server/src/test/java/org/prlprg/bc2c/BC2CCompilerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,8 @@ public void testIf(BC2CSnapshot snapshot) {
}

@Test
public void testAdhoc(BC2CSnapshot snapshot) {
public void testSubsetAndComplexAssign(BC2CSnapshot snapshot) {
// from bounce benchmark
snapshot.verify("""
b <- list()
b[[1]] <- c(1,2,3)
Expand Down
Binary file not shown.

0 comments on commit 1f51b19

Please sign in to comment.