diff options
author | Lev Walkin <vlm@lionet.info> | 2006-03-17 02:37:08 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2006-03-17 02:37:08 +0000 |
commit | 8838538855deb2c33389926e006da107857c3e60 (patch) | |
tree | f2c705bb420daa0b7cf25f76efc3a19d11db010b /libasn1fix/asn1fix_class.c | |
parent | 8c62613ba63539c22f2235395e1156fe28d555c3 (diff) |
class dereference
Diffstat (limited to 'libasn1fix/asn1fix_class.c')
-rw-r--r-- | libasn1fix/asn1fix_class.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libasn1fix/asn1fix_class.c b/libasn1fix/asn1fix_class.c index 5f124df3..b3bfae57 100644 --- a/libasn1fix/asn1fix_class.c +++ b/libasn1fix/asn1fix_class.c @@ -25,6 +25,25 @@ asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) { errno = ESRCH; return NULL; } + if(ioclass->expr_type == A1TC_REFERENCE) { + ioclass = asn1f_lookup_symbol(arg, + ioclass->module, ioclass->reference); + if(ioclass == NULL) { + errno = ESRCH; + return NULL; + } + } + if(ioclass->expr_type != A1TC_CLASSDEF) { + if(!(ioclass->_mark & TM_BROKEN)) { + ioclass->_mark |= TM_BROKEN; + FATAL("Class field %s lookup at line %d in something that is not a class: %s at line %d", + asn1f_printable_reference(ref), ref->_lineno, + ioclass->Identifier, + ioclass->_lineno); + } + errno = EINVAL; + return NULL; + } classfield = asn1f_lookup_child(ioclass, ref->components[1].name); if(classfield == NULL) { |