From: Marius Gavrilescu Date: Sat, 3 Mar 2018 11:57:39 +0000 (+0000) Subject: Add total bits check X-Git-Tag: 0.003~1 X-Git-Url: http://git.ieval.ro/?p=app-scheme79asm.git;a=commitdiff_plain;h=26bb1344da7ea217ce8820c6d85dc21e92eec68c Add total bits check --- 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}}) {