File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
java/org/truffleruby/core Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -529,4 +529,15 @@ protected long endHash(long hash) {
529
529
530
530
}
531
531
532
+ @ Primitive (name = "should_not_reach_here" )
533
+ public abstract static class ShouldNotReachHereNode extends PrimitiveArrayArgumentsNode {
534
+
535
+ @ Specialization (guards = "libString.isRubyString(message)" )
536
+ protected Object shouldNotReachHere (Object message ,
537
+ @ CachedLibrary (limit = "2" ) RubyStringLibrary libString ) {
538
+ throw CompilerDirectives .shouldNotReachHere (libString .getJavaString (message ));
539
+ }
540
+
541
+ }
542
+
532
543
}
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ module Errno
43
43
# Unlike rb_sys_fail(), handle does not raise an exception if errno is 0.
44
44
def self . handle ( additional = nil )
45
45
err = errno
46
- return if err == 0
46
+ Primitive . should_not_reach_here ( 'Errno.handle called but errno was 0' ) if err == 0
47
47
48
48
raise SystemCallError . new ( additional , err )
49
49
end
50
50
51
51
def self . handle_errno ( errno )
52
- return if errno == 0
52
+ Primitive . should_not_reach_here ( 'Errno.handle_errno called but errno was 0' ) if errno == 0
53
53
54
54
raise SystemCallError . new ( nil , errno )
55
55
end
You can’t perform that action at this time.
0 commit comments