From 88ad43b1f91f7cd2ba9c342c6c1a6da82e6088bf Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sun, 16 Jun 2019 07:49:06 +0000 Subject: re PR d/90651 (ICE in FuncDeclaration::semantic3, at d/dmd/func.c:1524) PR d/90651 d/dmd: Merge upstream dmd 0f6cbbcad Fixes segmentation fault in FuncDeclaration::semantic3. Reviewed-on: https://github.com/dlang/dmd/pull/10003 gcc/d/ChangeLog: 2019-06-16 Iain Buclaw * typeinfo.cc (object_module): New variable. (make_frontend_typeinfo): Update signature. Set temporary on generated TypeInfo classes. (create_tinfo_types): Set object_module. Move generation of front-end typeinfo into ... (create_frontend_tinfo_types): ... New function. (layout_typeinfo): Call create_frontend_tinfo_types. (layout_classinfo): Likewise. (layout_cpp_typeinfo): Likewise. (create_typeinfo): Likewise. From-SVN: r272345 --- gcc/d/dmd/func.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/d/dmd/func.c') diff --git a/gcc/d/dmd/func.c b/gcc/d/dmd/func.c index 568decc..04c70cf 100644 --- a/gcc/d/dmd/func.c +++ b/gcc/d/dmd/func.c @@ -1520,6 +1520,18 @@ void FuncDeclaration::semantic3(Scope *sc) { if (f->linkage == LINKd) { + // Variadic arguments depend on Typeinfo being defined + if (!global.params.useTypeInfo || !Type::dtypeinfo || !Type::typeinfotypelist) + { + if (!global.params.useTypeInfo) + error("D-style variadic functions cannot be used with -betterC"); + else if (!Type::typeinfotypelist) + error("`object.TypeInfo_Tuple` could not be found, but is implicitly used in D-style variadic functions"); + else + error("`object.TypeInfo` could not be found, but is implicitly used in D-style variadic functions"); + fatal(); + } + // Declare _arguments[] v_arguments = new VarDeclaration(Loc(), Type::typeinfotypelist->type, Id::_arguments_typeinfo, NULL); v_arguments->storage_class |= STCtemp | STCparameter; -- cgit v1.1