aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-09-06 14:51:18 +0200
committerSverker Eriksson <[email protected]>2016-09-06 14:51:18 +0200
commit08ff462b9302f62aafa20c1978d5ca148f03cdd3 (patch)
tree2078f28ad1ad783e4269b2256b5f5482306d64c5 /erts/emulator
parent6a79c1e1d020570d41f825a1ee5d8dd8d9546bc8 (diff)
parent02565089e3747a0f85125647b8ad2467e4c2b36d (diff)
downloadotp-08ff462b9302f62aafa20c1978d5ca148f03cdd3.tar.gz
otp-08ff462b9302f62aafa20c1978d5ca148f03cdd3.tar.bz2
otp-08ff462b9302f62aafa20c1978d5ca148f03cdd3.zip
Merge branch 'sverker/beam-too-few-functions/ERL-244/OTP-13848' into maint
* sverker/beam-too-few-functions/ERL-244: erts: Reject beam file with too few functions
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/beam_load.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index b7e802775d..f63addb309 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -2635,6 +2635,10 @@ load_code(LoaderState* stp)
* End of code found.
*/
case op_int_code_end:
+ if (function_number != stp->num_functions) {
+ LoadError2(stp, "too few functions (%u) in module (header said %u)",
+ function_number, stp->num_functions);
+ }
stp->codev_size = codev_size;
stp->ci = ci;
stp->function = THE_NON_VALUE;