cpp, using Node::operator[] with a char crashes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 248
- Forks
- 72
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 15
Description
In a test, i accidentally typed `'a'` instead of `"a"`
```
Node n;
n['a'] = "something";
```
The char `a` gets cast as int, which maps to a call to `Node::child(index_t idx)`, then this crashes b/c the int value of `a` is of course not a valid index.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Node::operator[] and Node::child(index_t idx), then inspect the existing test where the accidental n['a'] access was observed. The issue does not specify whether character indexing should be rejected or handled differently, so confirm the intended behavior before adding a regression test and verifying that the crash is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100