diff options
Diffstat (limited to 'aarch64/Asmgen.v')
-rw-r--r-- | aarch64/Asmgen.v | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/aarch64/Asmgen.v b/aarch64/Asmgen.v index ec680478..a3b21a88 100644 --- a/aarch64/Asmgen.v +++ b/aarch64/Asmgen.v @@ -336,8 +336,9 @@ Fixpoint unfold (bbs: Asmblock.bblocks) : res Asm.code := Definition transf_function (f: Asmblock.function) : res Asm.function := do c <- unfold (Asmblock.fn_blocks f); - OK {| Asm.fn_sig := Asmblock.fn_sig f - ; Asm.fn_code := c |}. + if zlt Ptrofs.max_unsigned (Z.of_nat (length c)) + then Error (msg "Asmgen.trans_function: code size exceeded") + else OK {| Asm.fn_sig := Asmblock.fn_sig f; Asm.fn_code := c |}. Definition transf_fundef (f: Asmblock.fundef) : res Asm.fundef := transf_partial_fundef transf_function f. |