Commit 24a56544 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix traceback handling on reraise (aka raise3)

parent 3e4896eb
......@@ -26,6 +26,12 @@ namespace pyston {
#ifndef NDEBUG
int AST::next_lineno = 100000;
AST::AST(AST_TYPE::AST_TYPE type) : type(type), lineno(++next_lineno) {
//if (lineno == 100644)
//raise(SIGTRAP);
}
#endif
llvm::StringRef getOpSymbol(int op_type) {
......
......@@ -149,12 +149,12 @@ public:
#ifndef NDEBUG
private:
// In debug mode, initialize lineno to something unique, so that if we see something ridiculous
// appear in the traceback, we can isolate the allocation which created it.
static int next_lineno;
public:
// In debug mode, initialize lineno to something unique, so that if we see something ridiculous
// appear in the traceback, we can isolate the allocation which created it.
AST(AST_TYPE::AST_TYPE type) : type(type), lineno(++next_lineno) {}
AST(AST_TYPE::AST_TYPE type);
#else
AST(AST_TYPE::AST_TYPE type) : type(type) {}
#endif
......
......@@ -247,7 +247,8 @@ void raise3(Box* arg0, Box* arg1, Box* arg2) {
exc_obj = exceptionNew2(c, arg1);
else
exc_obj = exceptionNew1(c);
raiseExc(exc_obj);
raiseRaw(ExcInfo(c, exc_obj, arg2));
} else {
raiseExcHelper(TypeError, "exceptions must be old-style classes or derived from BaseException, not %s",
getTypeName(arg0)->c_str());
......@@ -257,9 +258,7 @@ void raise3(Box* arg0, Box* arg1, Box* arg2) {
if (arg1 != None)
raiseExcHelper(TypeError, "instance exception may not have a separate value");
// TODO: should only allow throwing of old-style classes or things derived
// from BaseException:
raiseExc(arg0);
raiseRaw(ExcInfo(arg0, arg1, arg2));
}
void raiseExcHelper(BoxedClass* cls, const char* msg, ...) {
......
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