Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CharBuffer.addSlice does not properly handle starting offsets #278

Closed
2 of 12 tasks
Skyb0rg007 opened this issue May 23, 2023 · 1 comment
Closed
2 of 12 tasks

CharBuffer.addSlice does not properly handle starting offsets #278

Skyb0rg007 opened this issue May 23, 2023 · 1 comment
Assignees
Labels
basis-lib problem with Standard ML Basis library bug Something isn't working fixed-in-110.99.4 issues that will be fixed in the 110.99.4 version

Comments

@Skyb0rg007
Copy link

Skyb0rg007 commented May 23, 2023

Version

110.99.3 (Latest)

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

Processor

  • Any
  • Arm (using Rosetta)
  • PowerPC
  • Sparc
  • x86 (32-bit)
  • x86-64 (64-bit)
  • Other

System Component

SML/NJ Library

Severity

Minor

Description

CharBuffer.addSlice ignores the substring's starting offset.

Transcript

- val buf = CharBuffer.new 0;
- val substr = Substring.extract ("foo", 1, NONE);
- Substring.string substr;
val it = "oo" : string
- val () = CharBuffer.addSlice (buf, substr);
- CharBuffer.contents buf;
val it = "fo" : string

Expected Behavior

- val buf = CharBuffer.new 0;
- val () = CharBuffer.addSlice (buf, Substring.extract ("foo", 1, NONE));
- CharBuffer.contents buf;
val it = "oo" : string

Steps to Reproduce

- val buf = CharBuffer.new 0;
- val () = CharBuffer.addSlice (buf, Substring.extract ("foo", 1, NONE));
- CharBuffer.contents buf;
val it = "fo" : string

Additional Information

The same issue occurs with CharBuffer.addArrSlice.

Email address

ssoss AT uchicago DOT edu

@Skyb0rg007 Skyb0rg007 added the bug Something isn't working label May 23, 2023
@Skyb0rg007 Skyb0rg007 changed the title Real.fromLargeInt causes segfault on very large integers CharBuffer.addSlice does not properly handle starting offsets May 23, 2023
@JohnReppy JohnReppy added the basis-lib problem with Standard ML Basis library label May 23, 2023
@JohnReppy JohnReppy self-assigned this May 23, 2023
@JohnReppy JohnReppy added the fixed-in-110.99.4 issues that will be fixed in the 110.99.4 version label Jun 14, 2023
JohnReppy added a commit that referenced this issue Jun 14, 2023
@JohnReppy
Copy link
Contributor

This bug was present in both the CharBuffer and Word8Buffer structures; it has been fixed for 110.99.4 (and for 2023.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basis-lib problem with Standard ML Basis library bug Something isn't working fixed-in-110.99.4 issues that will be fixed in the 110.99.4 version
Projects
None yet
Development

No branches or pull requests

2 participants