diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-04-09 21:23:30 +0630 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-04-09 21:23:30 +0630 |
commit | 33e1d2ab72457dcba1aa2708554705fb31de4ba3 (patch) | |
tree | 394d8a69bf1ccceda12388e40c790a040fa9ebfa /lib/inst.c | |
parent | d256e06f518d701413dfb9bff6d00504f8c88109 (diff) | |
download | ovm-33e1d2ab72457dcba1aa2708554705fb31de4ba3.tar.gz ovm-33e1d2ab72457dcba1aa2708554705fb31de4ba3.tar.bz2 ovm-33e1d2ab72457dcba1aa2708554705fb31de4ba3.zip |
Added some TODOs to lib/inst.c to enforce endian
Diffstat (limited to 'lib/inst.c')
-rw-r--r-- | lib/inst.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -326,9 +326,11 @@ void inst_write_bytecode(inst_t inst, darr_t *darr) darr_append_byte(darr, inst.operand.as_byte); break; case DATA_TYPE_HWORD: + // TODO: Enforce endian here darr_append_bytes(darr, (byte *)&inst.operand.as_hword, HWORD_SIZE); break; case DATA_TYPE_WORD: + // TODO: Enforce endian here darr_append_bytes(darr, (byte *)&inst.operand.as_word, WORD_SIZE); break; } @@ -353,6 +355,7 @@ data_t read_type_from_darr(darr_t *darr, data_type_t type) return DBYTE(darr->data[darr->used++]); break; case DATA_TYPE_HWORD: + // TODO: Enforce endian here if (darr->used + HWORD_SIZE > darr->available) // TODO: Error (darr has no space left) return DWORD(0); @@ -362,6 +365,7 @@ data_t read_type_from_darr(darr_t *darr, data_type_t type) return DHWORD(u); break; case DATA_TYPE_WORD: + // TODO: Enforce endian here if (darr->used + WORD_SIZE > darr->available) // TODO: Error (darr has no space left) return DWORD(0); |