mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: 修复字节码函数调用跳过扩展字执行异常问题
This commit is contained in:
@@ -1191,12 +1191,13 @@ impl Vm {
|
||||
if !obj_ptr.is_null() {
|
||||
let obj = unsafe { &*obj_ptr };
|
||||
if obj.is_function() {
|
||||
if obj.native_fn().is_some() {
|
||||
// Native call - use extension word for arg_count
|
||||
let ext = self.bytecode[self.pc];
|
||||
self.pc += 1;
|
||||
let arg_count = (ext & 0xFF) as usize;
|
||||
// Always consume extension word for arg_count
|
||||
let ext = self.bytecode[self.pc];
|
||||
self.pc += 1;
|
||||
let arg_count = (ext & 0xFF) as usize;
|
||||
|
||||
if obj.native_fn().is_some() {
|
||||
// Native call
|
||||
let mut args_buf = [0u8; 257];
|
||||
args_buf[0] = this_reg;
|
||||
for i in 0..arg_count.min(256) {
|
||||
|
||||
Reference in New Issue
Block a user