Skip to content

CharBuffer.addSlice does not properly handle starting offsets #278

Description

@Skyb0rg007

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

basis-libproblem with Standard ML Basis librarybugSomething isn't workingfixed-in-110.99.4issues that will be fixed in the 110.99.4 version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions