From 26bb1344da7ea217ce8820c6d85dc21e92eec68c Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 3 Mar 2018 11:57:39 +0000 Subject: [PATCH] Add total bits check --- lib/App/Scheme79asm.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/App/Scheme79asm.pm b/lib/App/Scheme79asm.pm index 3ad0995..3d09b09 100644 --- a/lib/App/Scheme79asm.pm +++ b/lib/App/Scheme79asm.pm @@ -126,6 +126,8 @@ sub print_binary16 { my ($self, $fh) = @_; $fh //= \*STDOUT; + die "addr_bits + type_bits >= 16\n"if $self->{addr_bits} + $self->{type_bits} > 16; + my $length = @{$self->{memory}}; print $fh pack('n', $length); for (@{$self->{memory}}) { -- 2.39.2