mirror of
https://github.com/pocketpy/pocketpy
synced 2025-11-09 21:20:17 +00:00
some fix
This commit is contained in:
parent
c821a08f91
commit
a99b5ee381
@ -594,7 +594,12 @@ namespace pkpy{
|
||||
// vectorcall protocol
|
||||
for(auto& item: args) item->emit_(ctx);
|
||||
for(auto& item: kwargs){
|
||||
uint16_t index = StrName(item.first.sv()).index;
|
||||
i64 _val = StrName(item.first.sv()).index;
|
||||
if(is_imm_int(_val)){
|
||||
ctx->emit_(OP_LOAD_INTEGER, (uint16_t)_val, line);
|
||||
}else{
|
||||
ctx->emit_(OP_LOAD_CONST, ctx->add_const(py_var(ctx->vm, _val)), line);
|
||||
}
|
||||
ctx->emit_(OP_LOAD_INTEGER, index, line);
|
||||
item.second->emit_(ctx);
|
||||
}
|
||||
|
||||
@ -837,7 +837,7 @@ void VM::_prepare_py_call(PyObject** buffer, ArgsView args, ArgsView kwargs, con
|
||||
}
|
||||
|
||||
for(int j=0; j<kwargs.size(); j+=2){
|
||||
StrName key(_CAST(int, kwargs[j]));
|
||||
StrName key(_CAST(uint16_t, kwargs[j]));
|
||||
int index = decl->kw_to_index.try_get_likely_found(key);
|
||||
// if key is an explicit key, set as local variable
|
||||
if(index >= 0){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user