Fix VM: string handler no longer hijacks length() on non-strings; ArrayBox.length returns correct values (fixes json_lint loop). Add string-literal reader init guard earlier
This commit is contained in:
@ -120,7 +120,17 @@ pub fn seal_incomplete_phis_with<O: LoopPhiOps>(
|
||||
let value_after = ops
|
||||
.get_variable_at_block(&phi.var_name, latch_id)
|
||||
.ok_or_else(|| format!("Variable {} not found at latch block", phi.var_name))?;
|
||||
phi.known_inputs.push((latch_id, value_after));
|
||||
|
||||
// 🔧 ループ不変変数の自己参照PHI問題を修正
|
||||
// value_afterがPHI自身の場合(ループ内で変更されていない変数)は、
|
||||
// preheaderの値を使用する
|
||||
let latch_value = if value_after == phi.phi_id {
|
||||
// ループ不変変数:preheaderの値を使用
|
||||
phi.known_inputs[0].1 // preheaderからの初期値
|
||||
} else {
|
||||
value_after
|
||||
};
|
||||
phi.known_inputs.push((latch_id, latch_value));
|
||||
|
||||
ops.debug_verify_phi_inputs(block_id, &phi.known_inputs);
|
||||
ops.emit_phi_at_block_start(block_id, phi.phi_id, phi.known_inputs)?;
|
||||
|
||||
Reference in New Issue
Block a user