Skip to content

Commit

Permalink
Fixes #3851: Error when running string flip (#3852)
Browse files Browse the repository at this point in the history
When running with multidim, multiloc, and runtime checks, I was having the server crash with this error:
```
$CHPL_HOME/modules/internal/ChapelRange.chpl:2772: error: halt reached - With a positive count, the range must have a first index.
```

It ended up being a fairly easy fix once I ran it down... which took a second because this was a new error to me. This PR fixes #3851

Co-authored-by: Tess Hayes <stress-tess@users.noreply.github.com>
  • Loading branch information
stress-tess and stress-tess authored Oct 18, 2024
1 parent 22eeeea commit 0ee2a36
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/SegmentedMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -1204,14 +1204,13 @@ module SegmentedMsg {
retOffs = (+ scan retOffs) - retOffs;

var flippedVals = makeDistArray(strings.values.a.domain, uint(8));
forall (off, len, j) in zip(offs, lengths, ..#offs.size) with (var valAgg = newDstAggregator(uint(8))) {
forall (off, len, j) in zip(offs, lengths, 0..) with (var valAgg = newDstAggregator(uint(8))) {
var i = 0;
for b in interpretAsBytes(origVals, off..#len, borrow=true) {
valAgg.copy(flippedVals[retOffs[lengths.domain.high - j] + i], b:uint(8));
i += 1;
}
}

var retString = getSegString(retOffs, flippedVals, st);
var repMsg = "created " + st.attrib(retString.name) + "+created bytes.size %?".format(retString.nBytes);
smLogger.debug(getModuleName(),getRoutineName(),getLineNumber(),repMsg);
Expand Down

0 comments on commit 0ee2a36

Please sign in to comment.