Skip to content
  • Philip Chimento's avatar
    cairo: Take may_be_null into account in foreign struct conversion · 54a2acdd
    Philip Chimento authored
    Previously, when converting from a Cairo struct to a GIArgument, the
    "may_be_null" parameter would be ignored and a null pointer was always
    accepted (and then would probably crash, although this seems to be an
    unlikely case as we never got any bug reports of it.)
    
    Instead, we do a null check, and throw a JS exception if needed, in the
    foreign struct conversion callbacks in the various Cairo types.
    
    Requires exposing a previously static function in arg.cpp so that the
    thrown exceptions can have more useful messages.
    
    This bug was found with -Wunused-parameter.
    54a2acdd