Closed cboos closed 2 years ago
Duplicate of # Duplicate of #
Spam?
Spam?
Yes. We couldn't delete that.
GitHub must fix this behavior or prevent to post as spam.
@cboos Thank you for your pull request! It looks reasonable. I'll merge it soon.
In
ErrorHighlight::CoreExt#to_s
, thebacktrace_locations
is checked before use, but that check doesn't cover all the cases.If you happen to call directly
rb_funcallv
from a C program in an embedded Ruby scenario and an exception is raised, then thebacktrace_locations
will be an emptyArray
, notnil
. In such an application, my error reporting code callsto_s
on therb_errinfo()
value, and with Ruby 3.1 this results in aTypeError: wrong argument type nil (expected method)
as theErrorHighlight::CoreExt#to_s
method uses aloc
that is nownil
.I believe the correct thing to do here is to return
msg
as well.