MystenLabs/sui

Move lexer panics on empty block comment

Closed this issue · 2 comments

Steps to Reproduce Issue

Try to compile:

module hellow::hellow {
    public fun panics() { /**/ }
}

This panics the Move lexer, but if I add a space to the block comment (/* */) then it compiles.

Expected Result

I would expect I could compile an empty block comment.

Actual Result

$ sui move build
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING hellow
thread '<unnamed>' panicked at external-crates/move/crates/move-compiler/src/parser/lexer.rs:330:42:
begin <= end (53 <= 52) when slicing `module hellow::hellow {
    public fun panics() { /**/ }
}
`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-11-25T12:41:22.162001Z ERROR telemetry_subscribers: panicked at external-crates/move/crates/move-compiler/src/parser/lexer.rs:330:42:
begin <= end (53 <= 52) when slicing `module hellow::hellow {
    public fun panics() { /**/ }
}
` panic.file="external-crates/move/crates/move-compiler/src/parser/lexer.rs" panic.line=330 panic.column=42
Aborted (core dumped)

System Information

  • downloaded from sui-testnet-v1.38.1-ubuntu-x86_64.tgz
  • sui 1.38.1-b164e321fc9c

Thanks for the report @pb-at-talus! #20424 should fix it, I think.

Great, thanks!