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

Panic when evaluating single quote #57

Closed
5225225 opened this issue Sep 21, 2021 · 1 comment
Closed

Panic when evaluating single quote #57

5225225 opened this issue Sep 21, 2021 · 1 comment

Comments

@5225225
Copy link
Contributor

5225225 commented Sep 21, 2021

Just the input ' given to the web interpreter causes it to break.

Stack trace when using kalk 2.1.1 is

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:699:58
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/panicking.rs:103:14
   2: core::panicking::panic_bounds_check
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/panicking.rs:79:5
   3: <usize as core::slice::index::SliceIndex<[T]>>::index
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/slice/index.rs:184:10
   4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/slice/index.rs:15:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/alloc/src/vec/mod.rs:2464:9
   6: kalk::parser::split_into_variables
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:699:58
   7: kalk::parser::parse_identifier
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:693:9
   8: kalk::parser::parse_primary
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:544:34
   9: kalk::parser::parse_factorial
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:528:16
  10: kalk::parser::parse_exponent
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:516:16
  11: kalk::parser::parse_unary
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:507:16
  12: kalk::parser::parse_unit
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:487:16
  13: kalk::parser::parse_factor
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:444:20
  14: kalk::parser::parse_sum
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:430:20
  15: kalk::parser::parse_to
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:413:16
  16: kalk::parser::parse_equality
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:362:20
  17: kalk::parser::parse_expr
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:358:8
  18: kalk::parser::parse_stmt
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:202:38
  19: kalk::parser::parse
             at /home/jess/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/kalk-2.1.1/src/parser.rs:187:25
  20: scratch0RukYFR5I::main
             at ./main.rs:3:5
  21: core::ops::function::FnOnce::call_once
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@PaddiM8
Copy link
Owner

PaddiM8 commented Sep 22, 2021

Fixed!

@PaddiM8 PaddiM8 closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants