From 74b080994a4126fc501816ef70c563c724f5c025 Mon Sep 17 00:00:00 2001 From: Ry Date: Sun, 17 Apr 2022 17:03:20 -0700 Subject: [PATCH] fox32asm: Ensure consts are always Immediate32 --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4c71c86..ba03b1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -462,6 +462,7 @@ fn build_ast_from_expression(pair: pest::iterators::Pair) -> AstNode { } fn parse_constant(pairs: pest::iterators::Pairs) -> AstNode { + *CURRENT_SIZE.lock().unwrap() = Size::Word; let mut pairs = pairs; let constant_name = pairs.next().unwrap().into_inner().next().unwrap().as_str(); let operand_pair = pairs.next().unwrap(); @@ -1125,4 +1126,4 @@ fn node_to_immediate_values(node: &AstNode, instruction: &AssembledInstruction) _ => panic!("Attempting to parse a non-instruction AST node as an instruction: {:#?}", node), }; -} \ No newline at end of file +}