diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 10:43:05 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 10:43:05 +0000 |
| commit | d97c1c14b7f62fffc1ce54d4ff3354a5ee21743f (patch) | |
| tree | 1adf0e6be133132685ba81a251f94a6e3dad379a /std/vec.zc | |
| parent | 270eea5e23e3aeaa93aa0b483cba76cfee1f0df9 (diff) | |
Fix segfault caused in 'dfs.zc'
Diffstat (limited to 'std/vec.zc')
| -rw-r--r-- | std/vec.zc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -190,6 +190,14 @@ impl Vec<T> { return self.data[idx]; } + fn get_ref(self, idx: usize) -> T* { + if (idx >= self.len) { + !"Panic: Index out of bounds"; + exit(1); + } + return &self.data[idx]; + } + fn last(self) -> T { if (self.len == 0) { !"Panic: last called on empty Vec"; |
