crust icon indicating copy to clipboard operation
crust copied to clipboard

index out of bounds: the len is 10 but the index is 10

Open KisaragiEffective opened this issue 2 years ago • 2 comments

C++ code

// /tmp/test1.cc
struct simple {
	const char* hi;
};

int main(void) {
}

C++ compiler output

g++

$ rm ./a.out; g++ --version; g++ /tmp/test1.cc && ./a.out; echo $?
g++ (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

0

clang++

$ rm ./a.out; clang++ --version; clang++ /tmp/test1.cc && ./a.out; echo $?
Debian clang version 11.0.1-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
0

Error

$ crust --strict /tmp/test1.cc
Input file size : 138bytes 
TokenizingInvoking Parser....
thread 'main' panicked at 'index out of bounds: the len is 10 but the index is 10', src/library/parser/parser.rs:1700:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

KisaragiEffective avatar Sep 20 '22 05:09 KisaragiEffective

I haven't worked on in a long time, the parser I designed is pretty much unknown to me at this moment to dive right away. So been procrastinating on it on whether or not restart the work again. Feel free to make any changes and work on it by yourself. I hope to find the strength and motivation to work on it soon. Thanks.

NishanthSpShetty avatar Sep 20 '22 05:09 NishanthSpShetty

sure, maybe send some PRs in the future ;)

KisaragiEffective avatar Sep 20 '22 15:09 KisaragiEffective