mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user