Commit e088a2b0 authored by Lev Walkin's avatar Lev Walkin Committed by GitHub

Merge branch 'master' into windows-universal-build

parents 2aa10de1 9e0bf1b8
Full list of copyright holders:
Bartosz Marcinkiewicz <bma@megawatt.com.pl>
Bent Nicolaisen <BN@JAI.com>
brchiu @ github
Daniele Varrazzo <daniele.varrazzo@gmail.com>
mkhon @ github
Lev Walkin <vlm@lionet.info> Lev Walkin <vlm@lionet.info>
Wim L <wiml@omnigroup.com>
ymbirtt @ github
0.9.??: 0.9.??:
0.9.28: 2017-03-26
* PER decoding: avoid memory leak on error. By github.com/simo5 * PER decoding: avoid memory leak on error. By github.com/simo5
* Constness patch #46 by Wim L <wiml@omnigroup.com> (41bbf1c..78d604f). * Constness patch #46 by Wim L <wiml@omnigroup.com> (41bbf1c..78d604f).
Build issues: Build issues:
......
Copyright (c) 2003-2016 Lev Walkin <vlm@lionet.info> Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info> and contributors.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
......
...@@ -9,6 +9,6 @@ SUBDIRS = \ ...@@ -9,6 +9,6 @@ SUBDIRS = \
docsdir = $(datadir)/doc/asn1c docsdir = $(datadir)/doc/asn1c
docs_DATA = README.md FAQ ChangeLog BUGS TODO docs_DATA = README.md INSTALL.md FAQ ChangeLog BUGS TODO
EXTRA_DIST = README.md FAQ LICENSE BUGS EXTRA_DIST = README.md INSTALL.md FAQ LICENSE BUGS
...@@ -326,7 +326,7 @@ main(int ac, char **av) { ...@@ -326,7 +326,7 @@ main(int ac, char **av) {
* of another language. * of another language.
*/ */
if(asn1_compile(asn, skeletons_dir, asn1_compiler_flags, ac + optind, if(asn1_compile(asn, skeletons_dir, asn1_compiler_flags, ac + optind,
optind - 1, av - optind)) { optind, av - optind)) {
exit(EX_SOFTWARE); exit(EX_SOFTWARE);
} }
......
AC_INIT([asn1c],[0.9.28],[vlm@lionet.info]) AC_INIT([asn1c],[0.9.29],[vlm@lionet.info])
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
......
...@@ -113,7 +113,7 @@ set +x ...@@ -113,7 +113,7 @@ set +x
echo ' done; done; fi' echo ' done; done; fi'
echo " @if test -f sample-${ASN1PDU}-1.per ; then \\" echo " @if test -f sample-${ASN1PDU}-1.per ; then \\"
echo " for f in sample-*-[1-9].per; do \\" echo " for f in sample-*-[1-9].per; do \\"
echo ' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \' echo ' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\\1/"`; \'
echo ' for b in 1 17 33 980 8192; do \' echo ' for b in 1 17 33 980 8192; do \'
echo ' echo "Recoding $$f into DER into XER and back ($$b)..."; \' echo ' echo "Recoding $$f into DER into XER and back ($$b)..."; \'
echo ' ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \' echo ' ./${TARGET} -b $$b -p $$pdu -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \'
......
This diff is collapsed.
...@@ -38,6 +38,11 @@ asn1c_compiled_output(arg_t *arg, const char *fmt, ...) { ...@@ -38,6 +38,11 @@ asn1c_compiled_output(arg_t *arg, const char *fmt, ...) {
*/ */
if(dst->indented == 0) { if(dst->indented == 0) {
int i = dst->indent_level; int i = dst->indent_level;
if (i < 0) {
/* fatal error */
fprintf(stderr, "target %d : Indent level %d ?!\n", arg->target->target, i);
exit(1);
}
dst->indented = 1; dst->indented = 1;
while(i--) { while(i--) {
ret = asn1c_compiled_output(arg, "\t"); ret = asn1c_compiled_output(arg, "\t");
......
...@@ -17,6 +17,7 @@ typedef struct compiler_streams { ...@@ -17,6 +17,7 @@ typedef struct compiler_streams {
OT_INCLUDES, /* #include files */ OT_INCLUDES, /* #include files */
OT_DEPS, /* Dependencies (other than #includes) */ OT_DEPS, /* Dependencies (other than #includes) */
OT_FWD_DECLS, /* Forward declarations */ OT_FWD_DECLS, /* Forward declarations */
OT_FWD_DEFS, /* Forward definitions */
OT_TYPE_DECLS, /* Type declarations */ OT_TYPE_DECLS, /* Type declarations */
OT_FUNC_DECLS, /* Function declarations */ OT_FUNC_DECLS, /* Function declarations */
OT_POST_INCLUDE,/* #include after type definition */ OT_POST_INCLUDE,/* #include after type definition */
...@@ -35,7 +36,7 @@ typedef struct compiler_streams { ...@@ -35,7 +36,7 @@ typedef struct compiler_streams {
} compiler_streams_t; } compiler_streams_t;
static char *_compiler_stream2str[] __attribute__ ((unused)) static char *_compiler_stream2str[] __attribute__ ((unused))
= { "IGNORE", "INCLUDES", "DEPS", "FWD-DECLS", "TYPE-DECLS", "FUNC-DECLS", "POST-INCLUDE", "CTABLES", "CODE", "CTDEFS", "STAT-DEFS" }; = { "IGNORE", "INCLUDES", "DEPS", "FWD-DECLS", "FWD-DEFS", "TYPE-DECLS", "FUNC-DECLS", "POST-INCLUDE", "CTABLES", "CODE", "CTDEFS", "STAT-DEFS" };
int asn1c_compiled_output(arg_t *arg, const char *fmt, ...); int asn1c_compiled_output(arg_t *arg, const char *fmt, ...);
...@@ -56,8 +57,6 @@ int asn1c_compiled_output(arg_t *arg, const char *fmt, ...); ...@@ -56,8 +57,6 @@ int asn1c_compiled_output(arg_t *arg, const char *fmt, ...);
} while(0) } while(0)
#define EMBED(ev) do { \ #define EMBED(ev) do { \
int saved_target = arg->target->target; \
REDIR(OT_TYPE_DECLS); \
arg->embed++; \ arg->embed++; \
INDENTED(arg_t _tmp = *arg; \ INDENTED(arg_t _tmp = *arg; \
_tmp.expr = ev; \ _tmp.expr = ev; \
...@@ -66,8 +65,8 @@ int asn1c_compiled_output(arg_t *arg, const char *fmt, ...); ...@@ -66,8 +65,8 @@ int asn1c_compiled_output(arg_t *arg, const char *fmt, ...);
arg->embed--; \ arg->embed--; \
if(ev->expr_type != A1TC_EXTENSIBLE) \ if(ev->expr_type != A1TC_EXTENSIBLE) \
OUT(";\n"); \ OUT(";\n"); \
assert(arg->target->target == OT_TYPE_DECLS); \ assert(arg->target->target == OT_TYPE_DECLS || \
REDIR(saved_target); \ arg->target->target == OT_FWD_DEFS); \
} while(0) } while(0)
/* Output a piece of text into a default stream */ /* Output a piece of text into a default stream */
......
...@@ -283,6 +283,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int optc, char **argv) { ...@@ -283,6 +283,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int optc, char **argv) {
safe_fprintf(fp_h, "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"); safe_fprintf(fp_h, "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
SAVE_STREAM(fp_h, OT_DEPS, "Dependencies", 0); SAVE_STREAM(fp_h, OT_DEPS, "Dependencies", 0);
SAVE_STREAM(fp_h, OT_FWD_DECLS, "Forward declarations", 0); SAVE_STREAM(fp_h, OT_FWD_DECLS, "Forward declarations", 0);
SAVE_STREAM(fp_h, OT_FWD_DEFS, "Forward definitions", 0);
SAVE_STREAM(fp_h, OT_TYPE_DECLS, expr->Identifier, 0); SAVE_STREAM(fp_h, OT_TYPE_DECLS, expr->Identifier, 0);
SAVE_STREAM(fp_h, OT_FUNC_DECLS,"Implementation", 0); SAVE_STREAM(fp_h, OT_FUNC_DECLS,"Implementation", 0);
safe_fprintf(fp_h, "\n#ifdef __cplusplus\n}\n#endif\n"); safe_fprintf(fp_h, "\n#ifdef __cplusplus\n}\n#endif\n");
...@@ -305,7 +306,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int optc, char **argv) { ...@@ -305,7 +306,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int optc, char **argv) {
TQ_FOR(ot, &(cs->destination[OT_STAT_DEFS].chunks), next) TQ_FOR(ot, &(cs->destination[OT_STAT_DEFS].chunks), next)
safe_fwrite(ot->buf, ot->len, 1, fp_c); safe_fwrite(ot->buf, ot->len, 1, fp_c);
assert(OT_MAX == 11); /* Protection from reckless changes */ assert(OT_MAX == 12); /* Protection from reckless changes */
fclose(fp_c); fclose(fp_c);
fclose(fp_h); fclose(fp_h);
......
...@@ -673,10 +673,8 @@ _range_canonicalize(asn1cnst_range_t *range) { ...@@ -673,10 +673,8 @@ _range_canonicalize(asn1cnst_range_t *range) {
range->right = tmp; range->right = tmp;
} }
if(range->elements) { free(range->elements);
free(range->elements); range->elements = 0;
range->elements = 0;
}
range->el_size = 0; range->el_size = 0;
return 0; return 0;
} }
......
...@@ -166,7 +166,7 @@ asn1f_fetch_tags(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct a ...@@ -166,7 +166,7 @@ asn1f_fetch_tags(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, struct a
arg.expr = expr; arg.expr = expr;
count = asn1f_fetch_tags_impl(&arg, &tags, 0, 0, flags); count = asn1f_fetch_tags_impl(&arg, &tags, 0, 0, flags);
if(count <= 0 && tags) { if (count <= 0) {
free(tags); free(tags);
tags = 0; tags = 0;
} }
......
...@@ -23,14 +23,10 @@ void ...@@ -23,14 +23,10 @@ void
asn1p_constraint_free(asn1p_constraint_t *ct) { asn1p_constraint_free(asn1p_constraint_t *ct) {
if(ct) { if(ct) {
if(ct->containedSubtype) asn1p_value_free(ct->containedSubtype);
asn1p_value_free(ct->containedSubtype); asn1p_value_free(ct->value);
if(ct->value) asn1p_value_free(ct->range_start);
asn1p_value_free(ct->value); asn1p_value_free(ct->range_stop);
if(ct->range_start)
asn1p_value_free(ct->range_start);
if(ct->range_stop)
asn1p_value_free(ct->range_stop);
if(ct->elements) { if(ct->elements) {
while(ct->el_count--) { while(ct->el_count--) {
......
...@@ -246,20 +246,13 @@ asn1p_expr_free(asn1p_expr_t *expr) { ...@@ -246,20 +246,13 @@ asn1p_expr_free(asn1p_expr_t *expr) {
} }
free(expr->Identifier); free(expr->Identifier);
if(expr->reference) asn1p_ref_free(expr->reference);
asn1p_ref_free(expr->reference); asn1p_constraint_free(expr->constraints);
if(expr->constraints) asn1p_constraint_free(expr->combined_constraints);
asn1p_constraint_free(expr->constraints); asn1p_paramlist_free(expr->lhs_params);
if(expr->combined_constraints) asn1p_value_free(expr->value);
asn1p_constraint_free(expr->combined_constraints); asn1p_value_free(expr->marker.default_value);
if(expr->lhs_params) asn1p_wsyntx_free(expr->with_syntax);
asn1p_paramlist_free(expr->lhs_params);
if(expr->value)
asn1p_value_free(expr->value);
if(expr->marker.default_value)
asn1p_value_free(expr->marker.default_value);
if(expr->with_syntax)
asn1p_wsyntx_free(expr->with_syntax);
if(expr->data && expr->data_free) if(expr->data && expr->data_free)
expr->data_free(expr->data); expr->data_free(expr->data);
......
...@@ -27,8 +27,7 @@ asn1p_paramlist_free(asn1p_paramlist_t *pl) { ...@@ -27,8 +27,7 @@ asn1p_paramlist_free(asn1p_paramlist_t *pl) {
if(pl->params) { if(pl->params) {
int i = pl->params_count; int i = pl->params_count;
while(i--) { while(i--) {
if(pl->params[i].governor) asn1p_ref_free(pl->params[i].governor);
asn1p_ref_free(pl->params[i].governor);
free(pl->params[i].argument); free(pl->params[i].argument);
pl->params[i].governor = 0; pl->params[i].governor = 0;
pl->params[i].argument = 0; pl->params[i].argument = 0;
...@@ -82,8 +81,7 @@ asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) { ...@@ -82,8 +81,7 @@ asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) {
pl->params_count++; pl->params_count++;
return 0; return 0;
} else { } else {
if(pl->params[pl->params_count].governor) asn1p_ref_free(pl->params[pl->params_count].governor);
asn1p_ref_free(pl->params[pl->params_count].governor);
return -1; return -1;
} }
} }
......
...@@ -430,7 +430,7 @@ typedef union YYSTYPE ...@@ -430,7 +430,7 @@ typedef union YYSTYPE
} tv_nametag; } tv_nametag;
} }
/* Line 193 of yacc.c. */ /* Line 193 of yacc.c. */
#line 434 "y.tab.c" #line 434 "asn1p_y.c"
YYSTYPE; YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
...@@ -443,7 +443,7 @@ typedef union YYSTYPE ...@@ -443,7 +443,7 @@ typedef union YYSTYPE
/* Line 216 of yacc.c. */ /* Line 216 of yacc.c. */
#line 447 "y.tab.c" #line 447 "asn1p_y.c"
#ifdef short #ifdef short
# undef short # undef short
...@@ -2825,8 +2825,8 @@ yyreduce: ...@@ -2825,8 +2825,8 @@ yyreduce:
checkmem((yyval.a_plist)); checkmem((yyval.a_plist));
ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(1) - (1)].a_parg).governor, (yyvsp[(1) - (1)].a_parg).argument); ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(1) - (1)].a_parg).governor, (yyvsp[(1) - (1)].a_parg).argument);
checkmem(ret == 0); checkmem(ret == 0);
if((yyvsp[(1) - (1)].a_parg).governor) asn1p_ref_free((yyvsp[(1) - (1)].a_parg).governor); asn1p_ref_free((yyvsp[(1) - (1)].a_parg).governor);
if((yyvsp[(1) - (1)].a_parg).argument) free((yyvsp[(1) - (1)].a_parg).argument); free((yyvsp[(1) - (1)].a_parg).argument);
} }
break; break;
...@@ -2837,8 +2837,8 @@ yyreduce: ...@@ -2837,8 +2837,8 @@ yyreduce:
(yyval.a_plist) = (yyvsp[(1) - (3)].a_plist); (yyval.a_plist) = (yyvsp[(1) - (3)].a_plist);
ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(3) - (3)].a_parg).governor, (yyvsp[(3) - (3)].a_parg).argument); ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(3) - (3)].a_parg).governor, (yyvsp[(3) - (3)].a_parg).argument);
checkmem(ret == 0); checkmem(ret == 0);
if((yyvsp[(3) - (3)].a_parg).governor) asn1p_ref_free((yyvsp[(3) - (3)].a_parg).governor); asn1p_ref_free((yyvsp[(3) - (3)].a_parg).governor);
if((yyvsp[(3) - (3)].a_parg).argument) free((yyvsp[(3) - (3)].a_parg).argument); free((yyvsp[(3) - (3)].a_parg).argument);
} }
break; break;
...@@ -4795,7 +4795,7 @@ yyreduce: ...@@ -4795,7 +4795,7 @@ yyreduce:
/* Line 1267 of yacc.c. */ /* Line 1267 of yacc.c. */
#line 4799 "y.tab.c" #line 4799 "asn1p_y.c"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
......
...@@ -294,7 +294,7 @@ typedef union YYSTYPE ...@@ -294,7 +294,7 @@ typedef union YYSTYPE
} tv_nametag; } tv_nametag;
} }
/* Line 1529 of yacc.c. */ /* Line 1529 of yacc.c. */
#line 298 "y.tab.h" #line 298 "asn1p_y.h"
YYSTYPE; YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
......
...@@ -850,16 +850,16 @@ ParameterArgumentList: ...@@ -850,16 +850,16 @@ ParameterArgumentList:
checkmem($$); checkmem($$);
ret = asn1p_paramlist_add_param($$, $1.governor, $1.argument); ret = asn1p_paramlist_add_param($$, $1.governor, $1.argument);
checkmem(ret == 0); checkmem(ret == 0);
if($1.governor) asn1p_ref_free($1.governor); asn1p_ref_free($1.governor);
if($1.argument) free($1.argument); free($1.argument);
} }
| ParameterArgumentList ',' ParameterArgumentName { | ParameterArgumentList ',' ParameterArgumentName {
int ret; int ret;
$$ = $1; $$ = $1;
ret = asn1p_paramlist_add_param($$, $3.governor, $3.argument); ret = asn1p_paramlist_add_param($$, $3.governor, $3.argument);
checkmem(ret == 0); checkmem(ret == 0);
if($3.governor) asn1p_ref_free($3.governor); asn1p_ref_free($3.governor);
if($3.argument) free($3.argument); free($3.argument);
} }
; ;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <ANY.h> #include <ANY.h>
#include <errno.h> #include <errno.h>
static asn_OCTET_STRING_specifics_t asn_DEF_ANY_specs = { static asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
sizeof(ANY_t), sizeof(ANY_t),
offsetof(ANY_t, _asn_ctx), offsetof(ANY_t, _asn_ctx),
ASN_OSUBV_ANY ASN_OSUBV_ANY
...@@ -26,7 +26,7 @@ asn_TYPE_descriptor_t asn_DEF_ANY = { ...@@ -26,7 +26,7 @@ asn_TYPE_descriptor_t asn_DEF_ANY = {
0, 0, 0, 0, 0, 0, 0, 0,
0, /* No PER visible constraints */ 0, /* No PER visible constraints */
0, 0, /* No members */ 0, 0, /* No members */
&asn_DEF_ANY_specs, &asn_SPC_ANY_specs,
}; };
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = { static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
}; };
static asn_OCTET_STRING_specifics_t asn_DEF_BIT_STRING_specs = { static asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
sizeof(BIT_STRING_t), sizeof(BIT_STRING_t),
offsetof(BIT_STRING_t, _asn_ctx), offsetof(BIT_STRING_t, _asn_ctx),
ASN_OSUBV_BIT ASN_OSUBV_BIT
...@@ -38,7 +38,7 @@ asn_TYPE_descriptor_t asn_DEF_BIT_STRING = { ...@@ -38,7 +38,7 @@ asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
/ sizeof(asn_DEF_BIT_STRING_tags[0]), / sizeof(asn_DEF_BIT_STRING_tags[0]),
0, /* No PER visible constraints */ 0, /* No PER visible constraints */
0, 0, /* No members */ 0, 0, /* No members */
&asn_DEF_BIT_STRING_specs &asn_SPC_BIT_STRING_specs
}; };
/* /*
......
...@@ -13,7 +13,7 @@ static const ber_tlv_tag_t asn_DEF_BMPString_tags[] = { ...@@ -13,7 +13,7 @@ static const ber_tlv_tag_t asn_DEF_BMPString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (30 << 2)), /* [UNIVERSAL 30] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (30 << 2)), /* [UNIVERSAL 30] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
}; };
static asn_OCTET_STRING_specifics_t asn_DEF_BMPString_specs = { static asn_OCTET_STRING_specifics_t asn_SPC_BMPString_specs = {
sizeof(BMPString_t), sizeof(BMPString_t),
offsetof(BMPString_t, _asn_ctx), offsetof(BMPString_t, _asn_ctx),
ASN_OSUBV_U16 /* 16-bits character */ ASN_OSUBV_U16 /* 16-bits character */
...@@ -44,7 +44,7 @@ asn_TYPE_descriptor_t asn_DEF_BMPString = { ...@@ -44,7 +44,7 @@ asn_TYPE_descriptor_t asn_DEF_BMPString = {
/ sizeof(asn_DEF_BMPString_tags[0]), / sizeof(asn_DEF_BMPString_tags[0]),
&asn_DEF_BMPString_constraints, &asn_DEF_BMPString_constraints,
0, 0, /* No members */ 0, 0, /* No members */
&asn_DEF_BMPString_specs &asn_SPC_BMPString_specs
}; };
/* /*
......
...@@ -6,7 +6,7 @@ dist_pkgdata_DATA = \ ...@@ -6,7 +6,7 @@ dist_pkgdata_DATA = \
${srcdir}/*.[ch] \ ${srcdir}/*.[ch] \
${srcdir}/file-dependencies ${srcdir}/file-dependencies
smodsdir=$(pkgdata) smodsdir=$(pkgdatadir)
nobase_dist_smods_DATA = \ nobase_dist_smods_DATA = \
standard-modules/README \ standard-modules/README \
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = { static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) (ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
}; };
static const asn_OCTET_STRING_specifics_t asn_DEF_OCTET_STRING_specs = { static const asn_OCTET_STRING_specifics_t asn_SPC_OCTET_STRING_specs = {
sizeof(OCTET_STRING_t), sizeof(OCTET_STRING_t),
offsetof(OCTET_STRING_t, _asn_ctx), offsetof(OCTET_STRING_t, _asn_ctx),
ASN_OSUBV_STR ASN_OSUBV_STR
...@@ -45,7 +45,7 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { ...@@ -45,7 +45,7 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = {
/ sizeof(asn_DEF_OCTET_STRING_tags[0]), / sizeof(asn_DEF_OCTET_STRING_tags[0]),
0, /* No PER visible constraints */ 0, /* No PER visible constraints */
0, 0, /* No members */ 0, 0, /* No members */
&asn_DEF_OCTET_STRING_specs &asn_SPC_OCTET_STRING_specs
}; };
#undef _CH_PHASE #undef _CH_PHASE
...@@ -170,7 +170,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, ...@@ -170,7 +170,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
void **sptr, const void *buf_ptr, size_t size, int tag_mode) { void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
BIT_STRING_t *st = (BIT_STRING_t *)*sptr; BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
asn_dec_rval_t rval; asn_dec_rval_t rval;
asn_struct_ctx_t *ctx; asn_struct_ctx_t *ctx;
...@@ -519,7 +519,7 @@ OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -519,7 +519,7 @@ OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
asn_enc_rval_t er; asn_enc_rval_t er;
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
BIT_STRING_t *st = (BIT_STRING_t *)sptr; BIT_STRING_t *st = (BIT_STRING_t *)sptr;
enum asn_OS_Subvariant type_variant = specs->subvariant; enum asn_OS_Subvariant type_variant = specs->subvariant;
int fix_last_byte = 0; int fix_last_byte = 0;
...@@ -1112,7 +1112,7 @@ OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx, ...@@ -1112,7 +1112,7 @@ OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx,
OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr;
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
asn_struct_ctx_t *ctx; /* Per-structure parser context */ asn_struct_ctx_t *ctx; /* Per-structure parser context */
asn_dec_rval_t rval; /* Return value from the decoder */ asn_dec_rval_t rval; /* Return value from the decoder */
...@@ -1327,7 +1327,7 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, ...@@ -1327,7 +1327,7 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
asn_per_constraints_t *pc = constraints ? constraints asn_per_constraints_t *pc = constraints ? constraints
: td->per_constraints; : td->per_constraints;
asn_per_constraint_t *cval; asn_per_constraint_t *cval;
...@@ -1498,7 +1498,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, ...@@ -1498,7 +1498,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
asn_per_constraints_t *pc = constraints ? constraints asn_per_constraints_t *pc = constraints ? constraints
: td->per_constraints; : td->per_constraints;
asn_per_constraint_t *cval; asn_per_constraint_t *cval;
...@@ -1721,7 +1721,7 @@ OCTET_STRING_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) { ...@@ -1721,7 +1721,7 @@ OCTET_STRING_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) {
specs = td->specifics specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
ASN_DEBUG("Freeing %s as OCTET STRING", td->name); ASN_DEBUG("Freeing %s as OCTET STRING", td->name);
...@@ -1793,7 +1793,7 @@ OCTET_STRING_t * ...@@ -1793,7 +1793,7 @@ OCTET_STRING_t *
OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, const char *str, int len) { OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, const char *str, int len) {
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
? (asn_OCTET_STRING_specifics_t *)td->specifics ? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs; : &asn_SPC_OCTET_STRING_specs;
OCTET_STRING_t *st; OCTET_STRING_t *st;
st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size);
......
...@@ -13,7 +13,7 @@ static const ber_tlv_tag_t asn_DEF_UniversalString_tags[] = { ...@@ -13,7 +13,7 @@ static const ber_tlv_tag_t asn_DEF_UniversalString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), /* [UNIVERSAL 28] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), /* [UNIVERSAL 28] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
}; };
static asn_OCTET_STRING_specifics_t asn_DEF_UniversalString_specs = { static asn_OCTET_STRING_specifics_t asn_SPC_UniversalString_specs = {
sizeof(UniversalString_t), sizeof(UniversalString_t),
offsetof(UniversalString_t, _asn_ctx), offsetof(UniversalString_t, _asn_ctx),
ASN_OSUBV_U32 /* 32-bits character */ ASN_OSUBV_U32 /* 32-bits character */
...@@ -44,7 +44,7 @@ asn_TYPE_descriptor_t asn_DEF_UniversalString = { ...@@ -44,7 +44,7 @@ asn_TYPE_descriptor_t asn_DEF_UniversalString = {
/ sizeof(asn_DEF_UniversalString_tags[0]), / sizeof(asn_DEF_UniversalString_tags[0]),
&asn_DEF_UniversalString_constraints, &asn_DEF_UniversalString_constraints,
0, 0, /* No members */ 0, 0, /* No members */
&asn_DEF_UniversalString_specs &asn_SPC_UniversalString_specs
}; };
......
...@@ -103,11 +103,7 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } ...@@ -103,11 +103,7 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
* Check stack against overflow, if limit is set. * Check stack against overflow, if limit is set.
*/ */
#define ASN__DEFAULT_STACK_MAX (30000) #define ASN__DEFAULT_STACK_MAX (30000)
#ifdef _WIN32 static int GCC_NOTUSED
static int
#else
static int __attribute__((unused))
#endif
ASN__STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { ASN__STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) {
if(ctx && ctx->max_stack_size) { if(ctx && ctx->max_stack_size) {
......
...@@ -109,7 +109,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) { ...@@ -109,7 +109,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
(int)pd->moved, (int)pd->moved,
(((long)pd->buffer) & 0xf), (((long)pd->buffer) & 0xf),
(int)pd->nboff, (int)pd->nbits, (int)pd->nboff, (int)pd->nbits,
pd->buffer[0], ((pd->buffer != NULL)?pd->buffer[0]:0),
(int)(pd->nbits - pd->nboff), (int)(pd->nbits - pd->nboff),
(int)accum); (int)accum);
......
<!-- XML DTD generated by asn1c-0.9.28 --> <!-- XML DTD generated by asn1c-0.9.29 -->
<!-- ASN.1 module <!-- ASN.1 module
ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4) ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4)
......
...@@ -184,6 +184,19 @@ typedef enum other_PR { ...@@ -184,6 +184,19 @@ typedef enum other_PR {
struct Forest; struct Forest;
/*** <<< FWD-DEFS [Stuff] >>> ***/
typedef struct Member {
BIT_STRING_t cup_of_coffee;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Member;
/*** <<< TYPE-DECLS [Stuff] >>> ***/ /*** <<< TYPE-DECLS [Stuff] >>> ***/
typedef struct Stuff { typedef struct Stuff {
...@@ -194,16 +207,7 @@ typedef struct Stuff { ...@@ -194,16 +207,7 @@ typedef struct Stuff {
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
} *trees; } *trees;
struct anything { struct anything {
A_SET_OF(struct Member { A_SET_OF(Member) list;
BIT_STRING_t cup_of_coffee;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ) list;
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
......
...@@ -7,16 +7,20 @@ ...@@ -7,16 +7,20 @@
#include <constr_SEQUENCE.h> #include <constr_SEQUENCE.h>
#include <constr_SET_OF.h> #include <constr_SET_OF.h>
/*** <<< FWD-DEFS [Type] >>> ***/
typedef struct Member {
Type1_t t1;
Type2_t t2;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Member;
/*** <<< TYPE-DECLS [Type] >>> ***/ /*** <<< TYPE-DECLS [Type] >>> ***/
typedef struct Type { typedef struct Type {
A_SET_OF(struct Member { A_SET_OF(Member) list;
Type1_t t1;
Type2_t t2;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ) list;
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
......
...@@ -623,23 +623,27 @@ asn_TYPE_descriptor_t asn_DEF_Choice3 = { ...@@ -623,23 +623,27 @@ asn_TYPE_descriptor_t asn_DEF_Choice3 = {
struct Set; struct Set;
struct Sequence; struct Sequence;
/*** <<< FWD-DEFS [Set] >>> ***/
typedef struct Member {
long Int;
struct Set *set;
struct Sequence *seq;
struct Set *set2 /* OPTIONAL */;
/*
* This type is extensible,
* possible extensions are below.
*/
struct Set *set3;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Member;
/*** <<< TYPE-DECLS [Set] >>> ***/ /*** <<< TYPE-DECLS [Set] >>> ***/
typedef struct Set { typedef struct Set {
A_SET_OF(struct Member { A_SET_OF(Member) list;
long Int;
struct Set *set;
struct Sequence *seq;
struct Set *set2 /* OPTIONAL */;
/*
* This type is extensible,
* possible extensions are below.
*/
struct Set *set3;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ) list;
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
......
...@@ -622,23 +622,27 @@ asn_TYPE_descriptor_t asn_DEF_Choice3 = { ...@@ -622,23 +622,27 @@ asn_TYPE_descriptor_t asn_DEF_Choice3 = {
struct Set; struct Set;
struct Sequence; struct Sequence;
/*** <<< FWD-DEFS [Set] >>> ***/
typedef struct Member {
INTEGER_t Int;
struct Set *set;
struct Sequence *seq;
struct Set *set2 /* OPTIONAL */;
/*
* This type is extensible,
* possible extensions are below.
*/
struct Set *set3;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Member;
/*** <<< TYPE-DECLS [Set] >>> ***/ /*** <<< TYPE-DECLS [Set] >>> ***/
typedef struct Set { typedef struct Set {
A_SET_OF(struct Member { A_SET_OF(Member) list;
INTEGER_t Int;
struct Set *set;
struct Sequence *seq;
struct Set *set2 /* OPTIONAL */;
/*
* This type is extensible,
* possible extensions are below.
*/
struct Set *set3;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ) list;
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment