summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-11 14:10:00 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-11 14:10:00 (GMT)
commit6e3fe890d5fb3c80fac41df0fa1731c27668415c (patch)
treeba54284465c15be7b797189103ae37006a2edaff /tool
parent10ff0a2bbe31bb9121b6be79625ffc3ac54e032d (diff)
bare_instructions.rb: use Hash#fetch to read attr
to raise descriptive KeyError instead of NoMethodError in case these attrs are accidentally removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/ruby_vm/models/bare_instructions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/ruby_vm/models/bare_instructions.rb b/tool/ruby_vm/models/bare_instructions.rb
index 740949c..30a6e0f 100755
--- a/tool/ruby_vm/models/bare_instructions.rb
+++ b/tool/ruby_vm/models/bare_instructions.rb
@@ -102,11 +102,11 @@ class RubyVM::BareInstructions
end
def handles_sp?
- /\b(false|0)\b/ !~ @attrs['handles_sp'].expr.expr
+ /\b(false|0)\b/ !~ @attrs.fetch('handles_sp').expr.expr
end
def always_leaf?
- @attrs['leaf'].expr.expr == 'true;'
+ @attrs.fetch('leaf').expr.expr == 'true;'
end
def complicated_return_values?