From e5e560cbaf31dcce8221292e99ad4d8e34bf65d5 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 17 Nov 2010 00:26:41 +0900 Subject: [PATCH] Ensure struct params are small enough to fit in the param slots. --- tools/qfcc/source/function.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index e5ca0bd0e..0f133ee2f 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -146,6 +146,10 @@ parse_params (type_t *type, param_t *parms) } new.num_parms = -(new.num_parms + 1); } else if (p->type) { + if (type_size (p->type) > type_size (&type_param)) { + error (0, "param too large to be passed by value"); + return type; + } new.parm_types[new.num_parms] = p->type; new.num_parms++; }