Commit Graph

4974 Commits

Author SHA1 Message Date
Cyrill Gorcunov
7eb3b34ece travis: update nasmformat
No need to generate binaries, just compare
__OUTPUT_FORMAT__ output and add missing
formats.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 15:31:27 +03:00
Cyrill Gorcunov
4bedceb83c travis: add objexe
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 13:00:57 +03:00
Cyrill Gorcunov
31ad91346b travis: add time
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 12:57:08 +03:00
Cyrill Gorcunov
62b8ea045c travis: add selfref
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 12:50:08 +03:00
Cyrill Gorcunov
985f30df21 travis: add timesneg
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 16:47:36 +03:00
Cyrill Gorcunov
bbed2ce3ce travis: add pragma
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 16:43:17 +03:00
Cyrill Gorcunov
e85492c824 travis: add ppindirect
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 16:37:00 +03:00
Cyrill Gorcunov
b511da48c1 travis: add nullfile
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 16:33:28 +03:00
Cyrill Gorcunov
5d613ce88b travis: add br3392278
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 14:21:34 +03:00
Cyrill Gorcunov
52f82633d3 travis: add strlen
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 14:21:34 +03:00
Cyrill Gorcunov
b07ef09273 travis: add splitea test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 14:21:34 +03:00
Cyrill Gorcunov
35b3e90741 travis: add ssesize
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 14:21:30 +03:00
Cyrill Gorcunov
d06a193750 Merge branch 'nasm-2.15.xx'
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 13:53:50 +03:00
Cyrill Gorcunov
e7c2f0e51c doc/changes: Document rdf header fix
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 13:36:54 +03:00
Ozkan Sezer
723fb2cc33 rdoff/rdfwriteheader: Write object length and header length in correct order
Compared to 2.12.xx rdfwriteheader() writes the object length and header
length in flipped order.  Issue seems to have been introduced by commit
8dc965347d.

BR3392717

Signed-off-by: Ozkan Sezer <sezeroz@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-10 00:13:07 +03:00
Cyrill Gorcunov
19ab41466b outmacho: macho_dbg_linenum -- fix memory leak
In 78f14ab1a6 the fix
is incomplete, we should move free procedure out of
the list_for_each traverse.

CID 1432930

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-05 00:20:05 +03:00
Cyrill Gorcunov
5e587fda09 preproc: use explicit addressing while clearing smacro
Better point out explicitly that SMacro::next member
is untouched, thus do not use SMacro::next and an array.

CID 1432925

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-05 00:09:18 +03:00
Cyrill Gorcunov
78f14ab1a6 outmacho.c: macho_dbg_linenum - fix memory leak
If new list is not needed then we should free memory
allocated by nasm_basename and nasm_dirname calls.

CID 1432930

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-04 23:45:04 +03:00
Cyrill Gorcunov
858bc9d6b9 rdoff: search_libraries - zeroify stack allocated structure
Coverity scan tool complains on rdffile::rdoff_ver member
being called with memcpy uninitialized. Lets zap this
structure explicitly once we've it allocated.

CID 1432931

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-04 23:35:55 +03:00
Cyrill Gorcunov
c2ea414eb3 nasm-t: do not strip newlines from output
Currently we strip newlines from files on read and write
procedures for better diff output, but as being pointed
by hpa@ this makes quite inconvenient to work with tests
in a manual mode.

Thus lets left outputs as is. We have to update all tests
with template outputs since by default output streams are
ending with newline.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-18 01:07:53 +03:00
Cyrill Gorcunov
2f8a50d11e nasm-t: add fixme about data reading
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-18 00:49:11 +03:00
Cyrill Gorcunov
f77ec1c803 nasm-t: no need to strip json files
The json library can handle newlines by self.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-18 00:49:11 +03:00
H. Peter Anvin (Intel)
6f01aca07c asm/preproc.c: in tokenize() advance pointer past ? for TOKEN_QMARK
When we process a TOKEN_QMARK we also need to advance p, in order to
get the proper start for the next token.

This fixes travis test br3392707.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-11 18:37:35 -07:00
H. Peter Anvin (Intel)
ed63993519 Merge remote-tracking branch 'github/nasm-2.15.xx'
No conflicts.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-11 18:27:06 -07:00
H. Peter Anvin (Intel)
d85890aac7 Makefile.in: fix warning dependencies
Fix circular dependency on asm/warnings.c by factoring out
warnings.$(O) from the dependencies, and use a separate <file>.time
which "generate" the main source file as a "side effect", giving us a
null target.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-11 18:11:51 -07:00
H. Peter Anvin (Intel)
1a3bf7a3d7 warnings.pl: again, don't update the timestamp unless we need to
Don't update the timestamp unless we really have to do so.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-11 17:43:38 -07:00
H. Peter Anvin (Intel)
eeccbfe6ec .gitignore: ignore timestamp (*.time) files
Ignore timestamp files, they are transient.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-11 16:28:57 -07:00
H. Peter Anvin (Intel)
52848e8aba doc: improve documentation of %ifid et al
Clarify some of the semantics of %ifid, %ifnum, and %ifstr.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-11 16:28:57 -07:00
Cyrill Gorcunov
61265ecd15 travis: add br3392442
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-07 09:57:00 +03:00
Cyrill Gorcunov
08996ec2e5 travis: add br3392707
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-06 20:12:01 +03:00
Cyrill Gorcunov
463600ac22 travis: nasm-t -- fix --error option
Write "expected" or "over" if requested.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-06 20:02:53 +03:00
Cyrill Gorcunov
ff96ae3ffb travis: warnstack -- fix spaces
We use tabs in json so make it consistent.
No functional change.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-09-06 19:57:11 +03:00
H. Peter Anvin (Intel)
dab902cbdc preproc: when parsing an smacro template, don't mistake , for )
The operation of the ',' and ')' tokens are very similar, except for:

',' issues a error if the processed parameter is greedy;
')' sets the "done" variable.

The code would incorrectly set "done" for a ',' token. This fixes
travis test br3392711.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-04 14:35:49 -07:00
H. Peter Anvin (Intel)
6bd975476f nasm.h: correct TOKEN_LPAR and TOKEN_RPAR
These two symbolic names were reversed. In practice, the code uses '('
and ')' instead, so it wasn't a problem, but still very confusing.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-04 14:34:09 -07:00
H. Peter Anvin (Intel)
ff97eb6f7e preproc: don't loop on a variable that doesn't advance
When pasting and stripping %+ and whitespace tokens, we either need to
set *nextp in the loop, or treat next as a separate variable and
update *nextp after the loop finishes. This implements the second
option.

This fixes travis test "amx".

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-04 14:09:37 -07:00
H. Peter Anvin (Intel)
a9ed8ced7c preproc: add %eval() function, add back %isn*()
Add the %eval() preprocessor function. It evaluates each of its
arguments like a number and expands to a comma-separated lists of the
evaluated arguments.

To support this, add the concept of "true varadic" macros, which are
only used internally. True varadic macros differ from greedy macros in
that the parameter list is still parsed as individual parameters and
provided to the expansion function. As this isn't meaningful for
user-defined macros, there is no way to specify it from a directive.

Add back the %isnfoo() functions. Although one could just as well write
!%isfoo(), it doesn't cost much to provide them, and might help avoid
programmer confusion.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-09-04 13:52:32 -07:00
H. Peter Anvin (Intel)
cc64861a61 Merge tag 'nasm-2.15.05'
NASM 2.15.05

Resolved Conflicts:
	asm/preproc.c
	version

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-31 12:23:36 -07:00
H. Peter Anvin
214f2d4c56 NASM 2.15.05 2020-08-28 08:53:28 -07:00
H. Peter Anvin (Intel)
2f01a5ba4e NASM 2.15.05rc2 2020-08-27 13:07:04 -07:00
H. Peter Anvin (Intel)
bf79786e89 Add option to create reproducible output
We need the ability to produce consistent output for our own tests,
anyway, so make this a user-accessible feature. This was requested in
BR 3392635.

This obsoletes the NASM_TEST_RUN environment variable; simply use the
normal NASMENV environment variable instead.

The .obj tests in travis needed to be updated in order to remove the
rather pointless suffix " CONST" from the NASM signatures.

Reported-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-27 13:06:08 -07:00
H. Peter Anvin (Intel)
7497737aa2 travis: fix "warnstack" test
The "warnstack" test is supposed to test the warning stack, but the
[warning] directive is never seen in preprocess-only mode, so run it
in -f bin mode.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-27 12:22:09 -07:00
H. Peter Anvin (Intel)
48327377bd NASM 2.15.05rc1 2020-08-27 11:45:07 -07:00
H. Peter Anvin (Intel)
2b4886afdd BR 3392715: fix %ifid with $ and $$
%ifid $ and %ifid $$ has traditionally been false, revert to that
behavior.

Reported-by: Mike Hommey <mh+anfz@glandium.org>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-27 11:43:08 -07:00
H. Peter Anvin (Intel)
515f424296 nasm.h: fix comment for TOKEN_PREPROC_SQQ
This token is %*?? not %*?

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-25 17:38:31 -07:00
H. Peter Anvin (Intel)
cc843efa38 Merge tag 'nasm-2.15.04'
NASM 2.15.04

Conflicts:
	asm/listing.h
	asm/pptok.pl
	asm/preproc.c
	version

This doesn't pass travis test 3392711, which is using an extremely odd
construct of %?? in the middle of an argument sequence for an smacro
while not being in a macro itself, and expecting it to expand to the
macro name. This seems to *really* confuse the master branch.

Resolve this later...
2020-08-25 16:16:09 -07:00
H. Peter Anvin (Intel)
1227a5d7fb Merge remote-tracking branch 'github/master'
Resolved Conflicts:
	asm/preproc.c

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-25 15:56:05 -07:00
H. Peter Anvin (Intel)
16ab7aed21 debug: feed single-line macro definitions and include hierachy to dfmt
At least DWARF can encode C-style macros. In doing so, it wants the
file include hierarchy, so give the debug format backend the option of
receiving that information from the preprocessor.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-25 15:52:05 -07:00
H. Peter Anvin (Intel)
abcbe0ea38 outdbg: add macro to emulate .bin format ORG directive
Just stub out "org" as a macro to be able to read source files that
are designed for the .bin format.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-25 15:50:11 -07:00
H. Peter Anvin (Intel)
42de8879a2 listing: make "list engine active" part of the list options
List engine active is useful information in its own right.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-25 15:49:12 -07:00
H. Peter Anvin (Intel)
8c9b8ec2e2 srcfile: add src_nowhere()
Add src_nowhere() returning (null:0).

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2020-08-25 15:46:44 -07:00