Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix returning NULL from CallContext->get_attr #864

Merged
merged 1 commit into from

3 participants

@bdw
bdw commented

This commit checks for NULL in CallContext->get_attr,
and replaces it with PMCNULL. This fixes a crash in NQP,
which stopped me from building.

[Coke] has suggested to put this check into the (macro of) GET_ATTR,
which would save us the need to check for it everywhere, but we would
have to know it the retrieved attribute is a PMC or string or otherwise.

Bart Wiegmans This fixes checks for NULL in the return value of CallContext->get_attr,
and replaces it with PMCNULL. This fixes a crash in NQP, which stopped

[Coke] has suggested to put this check into the (macro of) GET_ATTR,
which would save us the need to check for it everywhere, but we would
have to know it the retrieved attribute is a PMC or string or otherwise.
7240c1b
@coke
Owner

+1 from me

@cotto cotto merged commit 7240c1b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 1, 2012
  1. This fixes checks for NULL in the return value of CallContext->get_attr,

    Bart Wiegmans authored
    and replaces it with PMCNULL. This fixes a crash in NQP, which stopped
    
    [Coke] has suggested to put this check into the (macro of) GET_ATTR,
    which would save us the need to check for it everywhere, but we would
    have to know it the retrieved attribute is a PMC or string or otherwise.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/pmc/callcontext.pmc
View
5 src/pmc/callcontext.pmc
@@ -1019,8 +1019,9 @@ return current Namespace
else
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_ATTRIB_NOT_FOUND, "No such attribute '%S'", key);
-
- return value;
+ if(value)
+ return value;
+ return PMCNULL;
}
VTABLE INTVAL elements() {
Something went wrong with that request. Please try again.