Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push NULL on stack instead of 0; sizeof(NULL) > sizeof(0) in MinGW64,… #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libasn1compiler/asn1c_C.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode
} while(0)

/* MKID_safe() without checking for reserved keywords */
#define MKID(expr) (asn1c_make_identifier(0, expr, 0))
#define MKID_safe(expr) (asn1c_make_identifier(AMI_CHECK_RESERVED, expr, 0))
#define MKID(expr) (asn1c_make_identifier(0, expr, NULL))
#define MKID_safe(expr) (asn1c_make_identifier(AMI_CHECK_RESERVED, expr, NULL))

int
asn1c_lang_C_type_REAL(arg_t *arg) {
Expand Down Expand Up @@ -741,7 +741,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
if(0)
tmp_memb.Identifier = strdup(
asn1c_make_identifier(0,
expr, "Member", 0));
expr, "Member", NULL));
assert(tmp_memb.Identifier);
}
tmp.default_cb(&tmp);
Expand Down Expand Up @@ -2426,7 +2426,7 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_
OUT("\"%s\",\n", p?p:"");
OUT("\"%s\",\n",
p ? asn1c_make_identifier(AMI_CHECK_RESERVED,
0, p, 0) : "");
0, p, NULL) : "");
} else {
OUT("\"%s\",\n", expr->Identifier);
OUT("\"%s\",\n", expr->Identifier);
Expand Down
10 changes: 5 additions & 5 deletions libasn1compiler/asn1c_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,23 +263,23 @@ asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
switch(_format) {
case TNF_UNMODIFIED:
return asn1c_make_identifier(AMI_MASK_ONLY_SPACES,
0, exprid ? exprid->Identifier : typename, 0);
0, exprid ? exprid->Identifier : typename, NULL);
case TNF_INCLUDE:
return asn1c_make_identifier(
AMI_MASK_ONLY_SPACES | AMI_NODELIMITER,
0, ((!stdname || (arg->flags & A1C_INCLUDES_QUOTED))
? "\"" : "<"),
exprid ? exprid->Identifier : typename,
((!stdname || (arg->flags & A1C_INCLUDES_QUOTED))
? ".h\"" : ".h>"), 0);
? ".h\"" : ".h>"), NULL);
case TNF_SAFE:
return asn1c_make_identifier(0, exprid, typename, 0);
return asn1c_make_identifier(0, exprid, typename, NULL);
case TNF_CTYPE: /* C type */
return asn1c_make_identifier(0, exprid,
exprid?"t":typename, exprid?0:"t", 0);
exprid?"t":typename, exprid?0:"t", NULL);
case TNF_RSAFE: /* Recursion-safe type */
return asn1c_make_identifier(AMI_CHECK_RESERVED, 0,
"struct", " ", typename, 0);
"struct", " ", typename, NULL);
}

assert(!"unreachable");
Expand Down