0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00
Commit Graph

5245 Commits

Author SHA1 Message Date
Cyrill Gorcunov
8c735c58d1 BR3392739: output/outbin: fix nil dereference for self following sections
In case if section follows itself we should yield
an error, otherwise we hit nil dereference because
there won't be any group of sections.

After all "follow" attribute is rather to group
sections other than self.



Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2021-02-21 01:05:28 +03:00
Cyrill Gorcunov
79ac0d686d Merge branch 'nasm-2.15.xx'
* nasm-2.15.xx:
  preproc: prohibit unmacro while macro expansion
2020-12-31 16:50:25 +03:00
Igor Munkin
f95c7e983c preproc: prohibit unmacro while macro expansion
If macro is undefined while it's being expanded, use after free occurs,
since the MMacro instance is released, but it is still used to proceed
the expansion.

This change forbids macro undefinition: non-fatal error is raised and
the MMacro instance is not released if it is being processed by NASM
preprocessor.

Consider the following example:
| $ cat test.asm
| %macro m 0
| %unmacro m 0
| %endmacro
| m
| $ ./nasm test.asm
| test.asm:4: error: `%unmacro' can't undefine the macro being expanded
| test.asm:2: ... from macro `m' defined here

Fixes BR3392531 and BR3392716.

Signed-off-by: Igor Munkin <imun@cpan.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-12-31 16:42:31 +03:00
Cyrill Gorcunov
dc4a619426 travis: add br3392637
Code for testcase provided by Suhwan.

Reported-by: Suhwan <prada960808@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-11-04 13:15:52 +03:00
Cyrill Gorcunov
93c774d482 BR3392637: output/outieee: Fix nil dereference
The handling been broken in commit 98578071.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-11-04 13:08:06 +03:00
Cyrill Gorcunov
e24e18e6b9 travis: add rdpid
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 23:06:45 +03:00
Cyrill Gorcunov
b3233c77fc travis: update avx
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 23:02:45 +03:00
Cyrill Gorcunov
4431776fc0 travis: add imm
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 22:12:02 +03:00
Cyrill Gorcunov
8ff5cecc29 travis: add ilog
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 22:01:21 +03:00
Cyrill Gorcunov
daa534e55c travis: add hle
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:54:10 +03:00
Cyrill Gorcunov
9d68a8babd travis: add hexfp
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:54:10 +03:00
Cyrill Gorcunov
32efe62b81 travis: add gather
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:54:10 +03:00
Cyrill Gorcunov
0137027911 travis: add floatx
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:54:06 +03:00
Cyrill Gorcunov
ecd704d846 travis: update float test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:40:36 +03:00
Cyrill Gorcunov
e715b61509 travis: add ctxlocal
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:14:59 +03:00
Cyrill Gorcunov
6334ea16ab travis: add cofftest
Lets run it as win32 since they are sharing
backends in most places but win32 is a way
more widely used.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:11:13 +03:00
Cyrill Gorcunov
247e8ef151 travis: add coffalign
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-15 00:07:03 +03:00
Cyrill Gorcunov
407fe40f66 travis: add insertps
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 15:57:08 +03:00
Cyrill Gorcunov
84c35517de travis: add masmdisp
It is failing right now so I'm not sure if
masm test is correct one. Lets merge it in
this form and update if needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 15:52:41 +03:00
Cyrill Gorcunov
c0e2bbc66a travis: add movd64
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 15:37:46 +03:00
Cyrill Gorcunov
5f753b9b0d travis: add movhpd
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2020-10-11 15:33:22 +03:00
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