From d2631c427ee723f6136ac1e08dd3c9c5b04c6725 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 24 Feb 2023 08:48:26 -0500 Subject: [PATCH] Fix RubyVM::CExpr#inspect @__LINE__ can be nil which causes the inspect method to fail. --- tool/ruby_vm/models/c_expr.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tool/ruby_vm/models/c_expr.rb b/tool/ruby_vm/models/c_expr.rb index 073112f545..4b5aec58dd 100644 --- a/tool/ruby_vm/models/c_expr.rb +++ b/tool/ruby_vm/models/c_expr.rb @@ -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