diff options
| author | Zoltán Kéri <z@zolk3ri.name> | 2025-01-03 19:16:56 +0100 |
|---|---|---|
| committer | Zoltán Kéri <z@zolk3ri.name> | 2025-01-03 19:16:56 +0100 |
| commit | a4a156290589751a741060c4a2e33e72f0ef21a8 (patch) | |
| tree | 58e541866530010ddb1fe83486d79ac052af5275 /core/encoding/base32 | |
| parent | fe88c22b1fa3b5090ae74dc358896ef784446469 (diff) | |
encoding/base32: Add `@(rodata)` attribute to default tables
Add `@(rodata)` attribute to `ENC_TABLE` and `DEC_TABLE` to mark
them as read-only data. This places these tables in the read-only
section of the executable, protecting them from modification
during program execution.
Diffstat (limited to 'core/encoding/base32')
| -rw-r--r-- | core/encoding/base32/base32.odin | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/encoding/base32/base32.odin b/core/encoding/base32/base32.odin index 0b8ec95c4..8629491b1 100644 --- a/core/encoding/base32/base32.odin +++ b/core/encoding/base32/base32.odin @@ -28,6 +28,7 @@ _validate_default :: proc(c: byte) -> bool { return (c >= 'A' && c <= 'Z') || (c >= '2' && c <= '7') } +@(rodata) ENC_TABLE := [32]byte { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', @@ -37,6 +38,7 @@ ENC_TABLE := [32]byte { PADDING :: '=' +@(rodata) DEC_TABLE := [256]u8 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |