]> iEval git - app-scheme79asm.git/commitdiff
Add total bits check
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 3 Mar 2018 11:57:39 +0000 (11:57 +0000)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 3 Mar 2018 11:57:39 +0000 (11:57 +0000)
lib/App/Scheme79asm.pm

index 3ad0995a3312799d74bb3588c902f1b7f023b266..3d09b09cf09b1d77adeb1de394136b6ebd0c0732 100644 (file)
@@ -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}}) {
This page took 0.032285 seconds and 4 git commands to generate.