-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Currently, in felt252_felt_dict_entry.rs
, eval_get
is implemented as follows:
pub fn eval_get(
registry: &ProgramRegistry<CoreType, CoreLibfunc>,
info: &SignatureAndTypeConcreteLibfunc,
args: Vec<Value>,
) -> EvalAction {
let [Value::FeltDict {
ty,
mut data,
mut count,
}, Value::Felt(key)]: [Value; 2] = args.try_into().unwrap()
else {
panic!()
};
assert_eq!(info.ty, ty);
let value = data
.entry(key)
.or_insert(Value::default_for_type(registry, &ty))
.clone();
count += 1;
EvalAction::NormalBranch(
0,
smallvec![
Value::FeltDictEntry {
ty,
data,
count,
key
},
value
],
)
}
This is actually wrong with respect to native who, instead of the key
, returns a pointer to the entry's value. What this means is that we should be returning this instead:
EvalAction::NormalBranch(
0,
smallvec![
Value::FeltDictEntry {
ty,
data,
count,
key
},
value
],
)
Metadata
Metadata
Assignees
Labels
No labels