Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
nqp::bitor_s and nqp::bitxor_s shouldn't truncate.
Fixes some failing bitwise operator tets for Rakudo JVM.
  • Loading branch information
jnthn committed Jun 22, 2013
1 parent ec11079 commit 2d93042
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -2868,9 +2868,9 @@ public static String bitor_s(String a, String b) {
StringBuilder r = new StringBuilder(mlength);
int apos = 0;
int bpos = 0;
while (apos < alength && bpos < blength) {
int cpa = a.codePointAt(apos);
int cpb = b.codePointAt(bpos);
while (apos < alength || bpos < blength) {
int cpa = apos < alength ? a.codePointAt(apos) : 0;
int cpb = bpos < blength ? b.codePointAt(bpos) : 0;
r.appendCodePoint(cpa | cpb);
apos += Character.charCount(cpa);
bpos += Character.charCount(cpb);
Expand All @@ -2885,9 +2885,9 @@ public static String bitxor_s(String a, String b) {
StringBuilder r = new StringBuilder(mlength);
int apos = 0;
int bpos = 0;
while (apos < alength && bpos < blength) {
int cpa = a.codePointAt(apos);
int cpb = b.codePointAt(bpos);
while (apos < alength || bpos < blength) {
int cpa = apos < alength ? a.codePointAt(apos) : 0;
int cpb = bpos < blength ? b.codePointAt(bpos) : 0;
r.appendCodePoint(cpa ^ cpb);
apos += Character.charCount(cpa);
bpos += Character.charCount(cpb);
Expand Down

0 comments on commit 2d93042

Please sign in to comment.