Repository navigation
Fix integer overflow panic on large display - #15
Merged
Merged
Conversation
sylr
commented
Nov 15, 2024
Contributor
```
$ zig-out/bin/DOOM-fire
Screen size: 375w x 89h
Standard colors:
▏ 0 ▏ 1 ▏ 2 ▏ 3 ▏ 4 ▏ 5 ▏ 6 ▏ 7
▏ 8 ▏ 9 ▏ 10 ▏ 11 ▏ 12 ▏ 13 ▏ 14 ▏ 15
216 colors:
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
88 89 90 91 92 93 94 95 96 97 98 99100101102103104105106107108109110111112113114115116117118119120121122123
124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
Grayscale:
▏232 ▏233 ▏234 ▏235 ▏236 ▏237 ▏238 ▏239 ▏240 ▏241 ▏242 ▏243 ▏244 ▏245 ▏246 ▏247 ▏248 ▏249 ▏250 ▏251 ▏252 ▏253 ▏254 ▏255
How much is the fish?
-- Scooter
Press return to continue...
thread 1068243 panic: integer overflow
/Users/sylvain/tmp/DOOM-fire-zig/src/main.zig:553:33: 0x104e7ab83 in showDoomFire (DOOM-fire)
const FIRE_SZ: u16 = FIRE_H * FIRE_W;
^
/Users/sylvain/tmp/DOOM-fire-zig/src/main.zig:695:17: 0x104e78d3b in main (DOOM-fire)
showDoomFire();
^
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/start.zig:524:37: 0x104e789d3 in main (DOOM-fire)
const result = root.main() catch |err| {
^
???:?:?: 0x19b517153 in ??? (???)
???:?:?: 0xa04fffffffffffff in ??? (???)
[1] 68669 abort zig-out/bin/DOOM-fire
```
Signed-off-by: Sylvain Rabot <[email protected]>
Owner
|
Thank you! Great fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.