Fix RubyVM::CExpr#inspect

@__LINE__ can be nil which causes the inspect method to fail.
This commit is contained in:
Peter Zhu 2023-02-24 08:48:26 -05:00
parent 05f016cdad
commit d2631c427e
Notes: git 2023-02-24 19:10:29 +00:00

View File

@ -36,6 +36,10 @@ class RubyVM::CExpr
end
def inspect
sprintf "#<%s:%d %s>", @__FILE__, @__LINE__, @expr
if @__LINE__
sprintf "#<%s:%d %s>", @__FILE__, @__LINE__, @expr
else
sprintf "#<%s %s>", @__FILE__, @expr
end
end
end