Skip to content

Commit

Permalink
Perlito5 - misc/Java-Asm-Interpreter/MethodExecutorAsm refactor gener…
Browse files Browse the repository at this point in the history
…ateClassName()
  • Loading branch information
fglock committed Aug 1, 2024
1 parent 6cbd666 commit c541fc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public static Class<?> createClassWithMethod(EmitterContext ctx, String[] env, N
// Create a ClassWriter with COMPUTE_FRAMES and COMPUTE_MAXS options for automatic frame and max stack size calculation
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);

// FIXME: this method signature says we return Runtime,
// for this reason we can't run the closure in VOID context
if (ctx.contextType == ContextType.VOID) {
ctx.contextType = ContextType.SCALAR;
}

// Create a "Java" class name with dots instead of slash
String javaClassNameDot = ctx.javaClassName.replace('/', '.');

Expand Down
2 changes: 1 addition & 1 deletion misc/Java-Asm-Interpreter/MethodExecutorAsm/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void main(String[] args) {
new ScopedSymbolTable(), // Top-level symbol table
null, // Return label
null, // Method visitor
ContextType.SCALAR, // Call context
ContextType.VOID, // Call context
true, // Is boxed
null, // errorUtil
debugEnabled // debugEnabled flag
Expand Down

0 comments on commit c541fc1

Please sign in to comment.