mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
internal/ops: remove some bounds checks
Currently BCE is unable to understand that the accesses in the code are safe. Added an explicit slice to make the length bounds obvious. Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
@@ -143,6 +143,7 @@ func (op *opMacroDef) decode(data []byte) {
|
||||
panic("invalid op")
|
||||
}
|
||||
bo := binary.LittleEndian
|
||||
data = data[:9]
|
||||
dataIdx := int(int32(bo.Uint32(data[1:])))
|
||||
refsIdx := int(int32(bo.Uint32(data[5:])))
|
||||
*op = opMacroDef{
|
||||
@@ -157,6 +158,7 @@ func (m *macroOp) decode(data []byte, refs []interface{}) {
|
||||
if opconst.OpType(data[0]) != opconst.TypeCall {
|
||||
panic("invalid op")
|
||||
}
|
||||
data = data[:9]
|
||||
bo := binary.LittleEndian
|
||||
dataIdx := int(int32(bo.Uint32(data[1:])))
|
||||
refsIdx := int(int32(bo.Uint32(data[5:])))
|
||||
|
||||
Reference in New Issue
Block a user