Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
box switch instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Storyyeller committed Jan 14, 2017
1 parent 33b67f4 commit 0343db1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions enjarify-rs/src/jvm/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub enum JvmInstructionSub {
OtherConstant,
Goto(GotoImpl),
If(IfImpl),
Switch(SwitchImpl),
Switch(Box<SwitchImpl>),
Other,
}
pub use self::JvmInstructionSub::*;
Expand Down Expand Up @@ -219,7 +219,7 @@ pub fn switch(default: u32, jumps: HashMap<i32, u32>) -> JvmInstruction {
let table_size = 4*(table_count+1);
let jump_size = 8*(jumps.len() as i64);

JvmInstruction{bytecode: None, sub: Switch(
JvmInstruction{bytecode: None, sub: Switch(Box::new(
SwitchImpl{
default: default,
jumps: jumps,
Expand All @@ -229,7 +229,7 @@ pub fn switch(default: u32, jumps: HashMap<i32, u32>) -> JvmInstruction {
is_table: jump_size > table_size,
nopad_size: 9 + min(jump_size, table_size) as u32,
}
)}
))}
}

pub fn other(bc: BString) -> JvmInstruction { JvmInstruction{bytecode: Some(bc), sub: Other} }
Expand Down

0 comments on commit 0343db1

Please sign in to comment.