diff --git a/core/translate/expr.rs b/core/translate/expr.rs index 4f61b8f31..9f1943bb5 100644 --- a/core/translate/expr.rs +++ b/core/translate/expr.rs @@ -448,7 +448,7 @@ pub fn translate_condition_expr( let cur_reg = program.alloc_register(); translate_expr(program, Some(referenced_tables), expr, cur_reg, resolver)?; program.emit_insn(Insn::IsNull { - src: cur_reg, + reg: cur_reg, target_pc: condition_metadata.jump_target_when_false, }); } diff --git a/core/vdbe/builder.rs b/core/vdbe/builder.rs index 0af4d1182..ca777e5ea 100644 --- a/core/vdbe/builder.rs +++ b/core/vdbe/builder.rs @@ -310,7 +310,7 @@ impl ProgramBuilder { Insn::IdxGT { target_pc, .. } => { resolve(target_pc, "IdxGT"); } - Insn::IsNull { src: _, target_pc } => { + Insn::IsNull { reg: _, target_pc } => { resolve(target_pc, "IsNull"); } _ => continue, diff --git a/core/vdbe/explain.rs b/core/vdbe/explain.rs index 490a677b7..41d70b46f 100644 --- a/core/vdbe/explain.rs +++ b/core/vdbe/explain.rs @@ -1034,14 +1034,14 @@ pub fn insn_to_str( 0, "".to_string(), ), - Insn::IsNull { src, target_pc } => ( + Insn::IsNull { reg, target_pc } => ( "IsNull", - *src as i32, + *reg as i32, target_pc.to_debug_int(), 0, OwnedValue::build_text(Rc::new("".to_string())), 0, - format!("if (r[{}]==NULL) goto {}", src, target_pc.to_debug_int()), + format!("if (r[{}]==NULL) goto {}", reg, target_pc.to_debug_int()), ), Insn::ParseSchema { db, where_clause } => ( "ParseSchema", diff --git a/core/vdbe/insn.rs b/core/vdbe/insn.rs index 354acbf10..f4c02d564 100644 --- a/core/vdbe/insn.rs +++ b/core/vdbe/insn.rs @@ -510,7 +510,7 @@ pub enum Insn { /// Check if the register is null. IsNull { /// Source register (P1). - src: usize, + reg: usize, /// Jump to this PC if the register is null (P2). target_pc: BranchOffset, diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs index 1d3100d5f..9c3410ba3 100644 --- a/core/vdbe/mod.rs +++ b/core/vdbe/mod.rs @@ -2389,8 +2389,8 @@ impl Program { cursors.get_mut(*cursor_id).unwrap().take(); state.pc += 1; } - Insn::IsNull { src, target_pc } => { - if matches!(state.registers[*src], OwnedValue::Null) { + Insn::IsNull { reg, target_pc } => { + if matches!(state.registers[*reg], OwnedValue::Null) { state.pc = target_pc.to_offset_int(); } else { state.pc += 1;