diff --git a/lib/asn1/gen_decode.c b/lib/asn1/gen_decode.c index f94948063..7f64248cd 100644 --- a/lib/asn1/gen_decode.c +++ b/lib/asn1/gen_decode.c @@ -32,6 +32,7 @@ */ #include "gen_locl.h" +#include "lex.h" RCSID("$Id$"); @@ -160,6 +161,14 @@ find_tag (const Type *t, *tag = t->tag.tagvalue; break; case TType: + if ((t->symbol->stype == Stype && t->symbol->type == NULL) + || t->symbol->stype == SUndefined) { + error_message("%s is imported or still undefined, " + " can't generate tag checking data in CHOICE " + "without this information", + t->symbol->name); + exit(1); + } find_tag(t->symbol->type, cl, ty, tag); return; case TUTCTime: