[bindc] Fix error in compiling ConditionStatements
Change-Id: I5748eb3be9984c04979459df50201f73b58aa3a3
diff --git a/tools/bindc/src/compiler.rs b/tools/bindc/src/compiler.rs
index 265877a..872d298 100644
--- a/tools/bindc/src/compiler.rs
+++ b/tools/bindc/src/compiler.rs
@@ -457,9 +457,9 @@
let rhs_symbol = self.lookup_value(rhs)?;
let instruction = match op {
ConditionOp::Equals => {
- SymbolicInstruction::AbortIfEqual { lhs: lhs_symbol, rhs: rhs_symbol }
+ SymbolicInstruction::AbortIfNotEqual { lhs: lhs_symbol, rhs: rhs_symbol }
}
- ConditionOp::NotEquals => SymbolicInstruction::AbortIfNotEqual {
+ ConditionOp::NotEquals => SymbolicInstruction::AbortIfEqual {
lhs: lhs_symbol,
rhs: rhs_symbol,
},
@@ -906,7 +906,7 @@
assert_eq!(
compile_statements(program.statements, &symbol_table),
Ok(vec![
- SymbolicInstruction::AbortIfEqual {
+ SymbolicInstruction::AbortIfNotEqual {
lhs: Symbol::Key("abc".to_string(), bind_library::ValueType::Number),
rhs: Symbol::NumberValue(42)
},
@@ -1002,7 +1002,7 @@
rhs: Symbol::NumberValue(1),
label: 1
},
- SymbolicInstruction::AbortIfEqual {
+ SymbolicInstruction::AbortIfNotEqual {
lhs: Symbol::Key("abc".to_string(), bind_library::ValueType::Number),
rhs: Symbol::NumberValue(2)
},
@@ -1013,13 +1013,13 @@
rhs: Symbol::NumberValue(2),
label: 2
},
- SymbolicInstruction::AbortIfEqual {
+ SymbolicInstruction::AbortIfNotEqual {
lhs: Symbol::Key("abc".to_string(), bind_library::ValueType::Number),
rhs: Symbol::NumberValue(3)
},
SymbolicInstruction::UnconditionalJump { label: 0 },
SymbolicInstruction::Label(2),
- SymbolicInstruction::AbortIfEqual {
+ SymbolicInstruction::AbortIfNotEqual {
lhs: Symbol::Key("abc".to_string(), bind_library::ValueType::Number),
rhs: Symbol::NumberValue(3)
},