Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
24a56544
Commit
24a56544
authored
Jan 21, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix traceback handling on reraise (aka raise3)
parent
3e4896eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
src/core/ast.cpp
src/core/ast.cpp
+6
-0
src/core/ast.h
src/core/ast.h
+3
-3
src/runtime/stacktrace.cpp
src/runtime/stacktrace.cpp
+3
-4
No files found.
src/core/ast.cpp
View file @
24a56544
...
...
@@ -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
)
{
...
...
src/core/ast.h
View file @
24a56544
...
...
@@ -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
...
...
src/runtime/stacktrace.cpp
View file @
24a56544
...
...
@@ -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
,
...)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment