This commit is contained in:
Nilton Constantino
2026-01-31 17:23:29 +00:00
parent dd61314bf9
commit e784dab34e
12 changed files with 688 additions and 191 deletions
+3 -3
View File
@@ -145,9 +145,9 @@ pub enum OpCode {
// --- 6.6 Functions ---
/// Calls a function at a specific address.
/// Operands: addr (u32), args_count (u32)
/// Stack: [arg0, arg1, ...] -> [return_value]
/// Calls a function by its index in the function table.
/// Operand: func_id (u32)
/// Stack: [arg0, arg1, ...] -> [return_slots...]
Call = 0x50,
/// Returns from the current function.
/// Stack: [return_val] -> [return_val]
+4 -1
View File
@@ -250,7 +250,10 @@ fn validate_module(module: &BytecodeModule) -> Result<(), LoadError> {
OpCode::PushBool => {
pos += 1;
}
OpCode::Call | OpCode::Alloc => {
OpCode::Call => {
pos += 4;
}
OpCode::Alloc => {
pos += 8;
}
_ => {}