fix: Resolve MIR phi value bug and HTTP error handling

- Fix MIR builder to correctly return phi values in if-else statements
  - Add extract_assigned_var helper to handle Program blocks
  - Update variable mapping after phi node creation
  - Fixes 'Value %14 not set' error in e2e_vm_http_client_error_result

- Fix HTTP plugin error handling for connection failures
  - Return error string instead of handle on tcp_ok=false
  - Enable proper ResultBox(Err) creation for failed connections
  - Now r.isOk() correctly returns false for connection errors

- Add VM fallback for toString() on any Box type
  - Ensures error messages can be displayed even without specific implementation

- All e2e_vm_http_client_error_result tests now pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-23 06:51:49 +09:00
parent 3b03d001ba
commit 494a864ed2
5 changed files with 123 additions and 8 deletions

View File

@ -1116,6 +1116,11 @@ impl VM {
}
}
// Generic fallback: toString for any Box type
if method == "toString" {
return Ok(Box::new(StringBox::new(box_value.to_string_box().value)));
}
// StringBox methods
if let Some(string_box) = box_value.as_any().downcast_ref::<StringBox>() {
match method {