Commit fa87f0bb authored by Marius Wachtler's avatar Marius Wachtler

Fix fastLocalsToBoxedLocals()

we can't use insert because it will not update existing values.
We did not hit this issue because I compared an instance with a class...
parent bf2bae9d
...@@ -990,8 +990,11 @@ Box* PythonFrameIterator::fastLocalsToBoxedLocals() { ...@@ -990,8 +990,11 @@ Box* PythonFrameIterator::fastLocalsToBoxedLocals() {
// TODO Right now d just has all the python variables that are *initialized* // TODO Right now d just has all the python variables that are *initialized*
// But we also need to loop through all the uninitialized variables that we have // But we also need to loop through all the uninitialized variables that we have
// access to and delete them from the locals dict // access to and delete them from the locals dict
if (frame_info->boxedLocals == dict_cls) { if (frame_info->boxedLocals->cls == dict_cls) {
((BoxedDict*)frame_info->boxedLocals)->d.insert(d->d.begin(), d->d.end()); BoxedDict* boxed_locals = (BoxedDict*)frame_info->boxedLocals;
for (auto&& new_elem : d->d) {
boxed_locals->d[new_elem.first] = new_elem.second;
}
} else { } else {
for (const auto& p : *d) { for (const auto& p : *d) {
Box* varname = p.first; Box* varname = p.first;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment