/*@fallthrough@*/
default:
e = parse_expr(parser_nasm, DIR_EXPR);
+ if (!e) {
+ yasm_vps_delete(vps);
+ return 0;
+ }
vp = yasm_vp_create_expr(id, e);
break;
}
* Note: this doesn't match NASM behavior, but is a lot more
* intelligent!
*/
- boundintn = yasm_expr_get_intnum(&boundval, 0);
- if (boundintn) {
+ if (boundval && (boundintn = yasm_expr_get_intnum(&boundval, 0))) {
unsigned long boundint = yasm_intnum_get_uint(boundintn);
/* Alignments must be a power of two. */
parser_nasm->prev_bc = NULL;
} else if (yasm__strcasecmp(name, "align") == 0) {
/* Really, we shouldn't end up with an align directive in an absolute
- * section (as it's supposed to be only used for nop fill, but handle
+ * section (as it's supposed to be only used for nop fill), but handle
* it gracefully anyway.
*/
if (parser_nasm->abspos) {
cur_line);
parser_nasm->abspos = yasm_expr_create_tree(
parser_nasm->abspos, YASM_EXPR_ADD, e, cur_line);
+ } else if (!valparams) {
+ yasm_error_set(YASM_ERROR_SYNTAX,
+ N_("directive `%s' requires an argument"), "align");
} else
dir_align(p_object, valparams, objext_valparams, line);
} else