Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -384,6 +384,7 @@ private DynamicObject concatNumeric(DynamicObject string, int c) {

if (enc == USASCIIEncoding.INSTANCE) {
if (c > 0xff) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(charRangeException(c));

}
@@ -395,6 +396,7 @@ private DynamicObject concatNumeric(DynamicObject string, int c) {

enc.codeToMbc(c, value.getUnsafeBytes(), value.getBegin() + value.getRealSize());
} catch (EncodingException e) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(charRangeException(c));
}

@@ -2244,6 +2246,7 @@ public DynamicObject capitalizeBang(DynamicObject string) {
final Encoding enc = value.getEncoding();

if (enc.isDummy()) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(
getContext().getCoreLibrary().encodingCompatibilityError(
String.format("incompatible encoding with this operation: %s", enc), this));

0 comments on commit 887e676

Please sign in to comment.