This merge contains fixes of bugs uncovered during conflict
resolution. After this merge, "make travis" passes!
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Resolved Conflicts:
The %line directives in weirdpaste.i now better reflect the actual
lines of the source code, just as we would have for debugging
output. Update the reference version of weirdpaste.i accordingly.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
%+ tokens can end up next to each other, or at the beginning or the
end of an expansion if we try to paste the output of empty
macros. This is perhaps particularly likely to happen in %[]
expressions.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1. Error messages would issue with the line number of %endrep.
2. Debug line information would ignore both macros and reps.
This is doubly wrong; macros are semantically equivalent to
inline functions, and it is expected that debuggers trace
into these functions.
These changes finishes the last parts of moving all responsibility for
the listing enable/disable into the preprocessor, so remove the
way over-complicated macro inhibit facility from the listing module
entirely.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
In preproc-only mode, we only ever execute a single pass, so we need
to still issue error messages created during that pass, otherwise we
don't even generate %warning or %error messages...
Reported-by: Jason Hood <jadoxa@yahoo.com.au>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It appears that at least with the Adobe Source fonts:
'hyphen' -> U+002D (ASCII)
'minus' -> U+2212
This is ugly for cut & paste purposes.
Reported-by: C. Masloch <pushbx@ulukai.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
recursion: see recursion.
A wrapper function needs to call the function being wrapped, not
itself.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The mailinglists have been migrated to lists.nasm.us
Signed-off-by: Jasper Lievisse Adriaanse <j@jasper.la>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Move the safe_alloc declaration after the * symbol to be consistent
with all other functions with this attribute. Just in case it matters
somewhere...
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The autoconf process automatically generates macros for function
attributes, including empty placeholders. Said empty placeholders also
propagate automatically into config/unconfig.h for the compilers which
don't support autoconf.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Fix the handling of %{:} macro operands. Use the same code for
expanding the subarguments as for normal arguments.
This (hopefully) resolves the following bug reports:
BR 3392611, BR 3392686, BR 3392688
Reported-by: <coconutfaistoslimeregistry@gmail.com>
Reported-by: Jasper Lievisse Adriaanse <r+nasm@jasper.la>
Reported-by: Jason Hood <jadoxa@yahoo.com.au>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
There is no reason to mention an ancient Amiga assembler as the source
for INCBIN, especially since it is supported by quite a few other
assemblers.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
clang, unlike gcc, will warn on inline functions which are
unused. This can happen if a function is either intended to be used in
the future, or it is only used under certain config options. Mark
those functions with the "unused" attribute; not only does it quiet
the warning, but it also documents it for the user.
Shuffle around the warning options in configure and add a few more
that are specific to clang.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The actual pointer value in offsetin() cancels out, but clang still
miscompiles offsetin() for an uninitialized pointer, considering the
value to be completely undefined. Initialize pointer being passed to
offsetin() to make clang happy; both the gcc and clang optimizers
discover later in the code that the initialization is unused and
removes it from the code.
Although technically undefined behavior, this is in my opinion a
severe quality of implementation bug in clang, and I will file a bug
report accordingly.
Reported-by: Jasper Lievisse Adriaanse <r+nasm@jasper.la>
Reported-by: David Bohman <debohman@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The name UNUSED is too generic and may conflict with future
macro definitions. This is machine-generated code anyway, so
rename UNUSED to UNUSED_HASH_ENTRY.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Change the left-leaning red-black (LLRB) trees into left-leaning
threaded red-black trees. Instead of NULL pointers at leaf nodes, use
the otherwise unused field as a pointer to the lexical predecessor
(left) or successor (right). This allows fast previous/next
interator operation without needing to keep track of the root of the
tree at all times.
The additional metadata that needs to be kept can be done for "free"
simply by changing "bool red" into a flag field.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
<res ...> can get rather annoying when mixed in with data, as can
happen with the MASM-like db syntax. List shorter blocks (8 bytes or
less) as ?? instead; 8 bytes avoids line breaks for a single
statement.
This is probably more readable anyway...
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Use a percentage size modifier for code/pre, which hopefully should
allow it to respect enclosing size modifications (for headings.)
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
When a warning documentation message contains more than one paragraph,
we have to indent the subsequent paragraphs using \> unless they are a
code paragraph (\c).
Improve a few warnings doc messages.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Pretty much all the backends have to do the same gymnastics to handle
symbols and sections. In the future, this should be done by the
assembly core, but in order to prepare the ground and get the
performance benefits as soon as possible, implement a library of
functions which can manage symbols and sections and their respective
hashes, trees, and tables.
This infrastructure is not yet used by any backend, that porting work
has to come next.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Add instructions for Intel Control Flow Enforcement Technology (CET).
Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>