Commit 92666536 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #1032 from undingen/fix_unwind

Fix two unwinding bugs I found while implementing #1031
parents bd361100 495c2289
...@@ -535,6 +535,7 @@ public: ...@@ -535,6 +535,7 @@ public:
void begin() { void begin() {
exc_info = ExcInfo(NULL, NULL, NULL); exc_info = ExcInfo(NULL, NULL, NULL);
pystack_extractor = PythonStackExtractor(); // resets skip_next_pythonlike_frame
t.restart(); t.restart();
static StatCounter stat("unwind_sessions"); static StatCounter stat("unwind_sessions");
...@@ -990,8 +991,11 @@ Box* PythonFrameIterator::fastLocalsToBoxedLocals() { ...@@ -990,8 +991,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