New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing up numba_do_raise #6017
Fixing up numba_do_raise #6017
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for refactoring this, it's much easier to follow now. Think this just needs a few comments adding about what functions do/their args and this is good to go.
numba/_helperlib.c
Outdated
/* | ||
* exc cannot be NULL | ||
* value can be NULL | ||
* loc can be NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's loc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was refactored out. the line can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 07415eb
return 1; | ||
} | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to expand the comment to include information about what this function does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 07415eb
numba/_helperlib.c
Outdated
Py_XDECREF(type); | ||
return 0; | ||
/* | ||
* PyExceptionClass_Check(exc) must be True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to expand the comment to include information about what this function does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 07415eb
Py_XDECREF(type); | ||
return 0; | ||
static | ||
int reraise_exc_is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to expand the comment to include information about what this function does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 07415eb
PyObject *exc = NULL, *type = NULL, *value = NULL, *loc = NULL; | ||
|
||
static | ||
void traceback_add_loc(PyObject *loc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to include a comment about what this function does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 07415eb
BFID: |
BF passed except the aarch64 problem that is affecting other PRs. |
Fix typos.
This patch attempts to fix an extra decref in
numba_do_raise()
as discovered in #5922 which will result in segfault as described in #5922 (comment)The patch refactored the
numba_do_raise()
function into multiple functions for easier debugging. As a result, there are less incref/decref needed. Sub-functions are mostly borrowing references.