Commit ce233891 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix bare raise

parent 19e1b6d8
......@@ -681,6 +681,9 @@ ExcInfo* getFrameExcInfo() {
FrameInfo* frame_info = getTopFrameInfo();
while (frame_info) {
if (copy_from_exc)
to_update.push_back(copy_from_exc);
copy_from_exc = &frame_info->exc;
if (!cur_exc)
cur_exc = copy_from_exc;
......@@ -688,7 +691,6 @@ ExcInfo* getFrameExcInfo() {
if (copy_from_exc->type)
break;
to_update.push_back(copy_from_exc);
frame_info = frame_info->back;
};
......@@ -700,6 +702,7 @@ ExcInfo* getFrameExcInfo() {
}
for (auto* ex : to_update) {
assert(ex != copy_from_exc);
*ex = *copy_from_exc;
Py_INCREF(ex->type);
Py_INCREF(ex->value);
......
......@@ -159,7 +159,6 @@ ExcInfo excInfoForRaise(STOLEN(Box*) type, STOLEN(Box*) value, STOLEN(Box*) tb)
}
extern "C" void raise0(ExcInfo* frame_exc_info) {
assert(0 && "check refcounting");
updateFrameExcInfoIfNeeded(frame_exc_info);
assert(frame_exc_info->type);
......@@ -169,6 +168,10 @@ extern "C" void raise0(ExcInfo* frame_exc_info) {
startReraise();
assert(!PyErr_Occurred());
Py_INCREF(frame_exc_info->type);
Py_INCREF(frame_exc_info->value);
Py_INCREF(frame_exc_info->traceback);
throw * frame_exc_info;
}
......
......@@ -285,7 +285,7 @@ extern "C" void setFrameExcInfo(FrameInfo* frame_info, STOLEN(Box*) type, STOLEN
if (old_type) {
Py_DECREF(old_type);
Py_DECREF(old_value);
Py_DECREF(old_traceback);
Py_XDECREF(old_traceback);
}
}
......
# expected: reffail
import imp
print len(imp.find_module("os"))
e = imp.find_module("encodings")
......
# expected: reffail
import traceback
import sys
def f():
......
# expected: reffail
# This is the same as incremental_tb_bjit.py but tests the baseline JIT.
try:
import __pyston__
......
# expected: reffail
import sys
import traceback
......
# expected: reffail
# try-finally support
import sys
......
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