forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix string localization bug in some IO read procedures (chapel-lang#2…
…4444) Fix a bug where `readTo`, `readThrough` and `readLine` were not handling non-local string/bytes arguments properly. These methods all rely on `readStringBytesData`, which accessed a string/bytes argument's buffer regardless of whether it was declared locally. It now checks whether the argument is local, and if not, creates a local temporary string/bytes to complete the operation. New tests are added to ensure the methods behave properly when called with non-local arguments (note: the multilocale behavior of `readLine` is locked in by some tests added in chapel-lang#24323 — this PR removes the `notest`s from those). resolves: chapel-lang#24443 - [x] local paratest - [x] gasnet paratest [ reviewed by @ShreyasKhandekar ] - thanks!
- Loading branch information
Showing
12 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use IO; | ||
|
||
var fr = openReader("listInput.txt", locking=false); | ||
|
||
test(fr, Locales[0], Locales[1]); | ||
test(fr, Locales[1], Locales[0]); | ||
test(fr, Locales[1], Locales[1]); | ||
test(fr, Locales[1], Locales[2]); | ||
|
||
proc test(fr, L1: locale, L2: locale) { | ||
on L1 { | ||
var s = "", b = b""; | ||
on L2 { | ||
fr.readThrough(",", s); | ||
fr.readThrough(b",", b); | ||
} | ||
writeln(s); | ||
writeln(b); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
1, | ||
2, | ||
3, | ||
4, | ||
5, | ||
6, | ||
7, | ||
8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHPL_COMM==none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1,2,3,4,5,6,7,8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use IO; | ||
|
||
var fr = openReader("listInput.txt", locking=false); | ||
|
||
test(fr, Locales[0], Locales[1]); | ||
test(fr, Locales[1], Locales[0]); | ||
test(fr, Locales[1], Locales[1]); | ||
test(fr, Locales[1], Locales[2]); | ||
|
||
proc test(fr, L1: locale, L2: locale) { | ||
on L1 { | ||
var s = "", b = b""; | ||
on L2 { | ||
fr.readTo(",", s); | ||
fr.matchLiteral(","); | ||
fr.readTo(b",", b); | ||
fr.matchLiteral(","); | ||
} | ||
writeln(s); | ||
writeln(b); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHPL_COMM==none |
Empty file.
Empty file.