summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* NASM 2.15rc11nasm-2.15rc11H. Peter Anvin (Intel)2020-06-251-1/+1
|
* BR 3392651: fix the .debug$T section in Codeview output formatH. Peter Anvin (Intel)2020-06-251-24/+20
| | | | | | | | | | | | | | The cv8 output format would generate an invalid .debug$T section, containing repeated invalid records, none of which are actually used (which is probably the only reason it actually worked.) Just in case, generate a *single* type record for void func(void); Furthermore, the argument list record should come before the procedure type record (forward references are at least normatively prohibited.) Reported-by: Alexandre Ganea <alexandre.ganea@ubisoft.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc10nasm-2.15rc10H. Peter Anvin (Intel)2020-06-221-1/+1
|
* BR 3392681: handle a64 instruction patters correctlyH. Peter Anvin (Intel)2020-06-223-4/+25
| | | | | | | | | | The a64 instruction patterns would incorrectly force REX to zero at a point where REX prefixes have already been assigned. This is not only incorrect in case of instructions which can use high registers, but it causes an assertion failure. It happened to work for J*CXZ and LOOP*. Reported-by: Philip Lantz <philip.lantz@intel.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* BR 3392648: rename float.[ch] to floats.[ch]H. Peter Anvin (Intel)2020-06-149-13/+13
| | | | | | | | | Haiku apparently wants to include <float.h> rather than "float.h". Rename float.[ch] to floats.[ch] to avoid unnecessary namespace confusion. Reported-by: <alaviss0+nasm@gmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc9nasm-2.15rc9H. Peter Anvin (Intel)2020-06-141-1/+1
|
* BR 3392657: dwarf: leave .debug_frame emptyH. Peter Anvin (Intel)2020-06-141-3/+8
| | | | | | | | Until such time that we have a CFI code generator, leave .debug_frame empty. Reported-by: Philip Craig <philipjcraig@gmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc8nasm-2.15rc8H. Peter Anvin (Intel)2020-06-141-1/+1
|
* doc: various documentation updatesH. Peter Anvin (Intel)2020-06-142-106/+265
|
* %line: quote filenames with double spaces, use unsigned char checkH. Peter Anvin (Intel)2020-06-141-3/+8
| | | | | | | | | | Filenames with double spaces need to be quoted; the preprocessor will otherwise collapse spaces into one. When comparing for control characters and spaces, use an unsigned compare. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc, srcfile: much saner handling of %line directivesH. Peter Anvin (Intel)2020-06-145-160/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | %line directives really need to be preprocessed early, before normal directive processing. In particular, they are *not* affected by such thing as smacro expansion, or deferred into an mmacro expansion. The %line directive is special because it is explicitly indented to be inserted by an external preprocessor, which can happen at any point. For mmacro and rep expansions, store the current file and line for each expansion line. Similarly, let each istk entry contain such information. Don't emit empty lines in preprocessing-only mode when we are already required to issue a %line directive anyway. This cuts down on clutter a fair bit. Quote filenames in %line directives (and accept quoted filenames in %line directives) if and only if it is necessary for disambiguation. This is required if: 1. The filename contains control characters; 2. The filename begins or ends with whitespace or a quotation mark; 3. The filename is empty. Otherwise issue the filename as-is, for backwards compatibility. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc.c: make extra sure we always have a null-terminated tokenH. Peter Anvin (Intel)2020-06-141-7/+13
| | | | | | | | | | | tok_set_text() and tok_set_text_free() take a length argument, which could at least theoretically mean that we don't have a null-terminated string. Directly enforce a null-terminated string in all cases. In the future this means that it is legal to intentionally use these functions to tokenize a substring. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc.c: make extra sure tokens are always null-terminatedH. Peter Anvin (Intel)2020-06-141-7/+10
| | | | | | | In tok_set_text() and tok_set_text_free(), don't trust that the caller has given us a zero-terminated string. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: even more handling of backwards compatibility for mmacrosH. Peter Anvin (Intel)2020-06-142-99/+162
| | | | | | | | | Legacy multi-line macro argument expansion really is very complicated. With these changes, all legacy tests seem to pass, and the only differences with NASM 2.14.xx are that some macros which should have been expanded and were not now are. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc7nasm-2.15rc7H. Peter Anvin (Intel)2020-06-081-1/+1
|
* preproc: %clear options, backwards compatibility hack for x264H. Peter Anvin (Intel)2020-06-081-107/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | The handling of empty arguments in NASM 2.14 and below was at best "interesting"; a single whitespace token expansion, which can happen during macro expansion, would sometimes be counted as an argument and sometimes not. One really weird effect of this was that %0 doesn't always match the permitted range in the macro specification! Add some backwards compatibility code to make x264/ffmpeg compile. Add override via: %pragma preproc sane_empty_expansion true Add support for %clear to clear specific subsets of the macro definitions. In particular: %clear defalias ... can be used to wipe the __FOO__ backwards macro compatibility aliases which may interfere with the C namespace. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* hashtbl.c: don't call nasm_free() for a null pointerH. Peter Anvin (Intel)2020-06-081-2/+3
| | | | | | | There really isn't much point in calling nasm_free() everywhere, even with a null pointer... Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: need to look at mmac->in_progress not mstk->in_progressH. Peter Anvin (Intel)2020-06-081-2/+3
| | | | | | | | | | mstk.mstk reflects %rep conditions as well as actual expanded macros. However, in_progress is undefined for %rep loops; we instead want to look at the underlying mmacro, if there is one. Discovered trying to compile x264. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc6nasm-2.15rc6H. Peter Anvin (Intel)2020-06-051-1/+1
|
* travis: utf-error.stderr: remove unnecessary error messageH. Peter Anvin (Intel)2020-06-051-3/+0
| | | | | | | The error message "comma expected after operand 2" no longer occurs in this program, this is an acceptable divergence, however. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* .gitignore: add *.pdf.xzH. Peter Anvin (Intel)2020-06-051-0/+1
| | | | | | Add *.pdf.xz to the gitignore file. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* Fix missing "here" from error messagesH. Peter Anvin (Intel)2020-06-051-0/+4
| | | | | | | The "here" or "in an unknown location" suffix was inadvertently dropped. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* travis: test avx512f should now passH. Peter Anvin (Intel)2020-06-053-574/+1
| | | | Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* avx512: remove bogus imm8 for specific VCMP and VPCMP operationsH. Peter Anvin (Intel)2020-06-051-584/+584
| | | | | | | When using VCMP and VPCMP operations with the condition in the opcode, we should not have an immediate operand! Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* avx512: implement shorthand forms of VCMP and VPCMP opcodesH. Peter Anvin (Intel)2020-06-051-25/+585
| | | | | | | The VCMP and VPCMP pseudo-op forms where the destination is a mask were simply broken. Fix them. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: %ifdef needs to accept any argument countH. Peter Anvin (Intel)2020-06-051-1/+1
| | | | | | | | %ifdef should accept any argument count. However, requiring a macro structure return means we have to use the wildcard argument number (-1), not 0 meaning exactly 0 arguments. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* test/ifdef.asm: test for simple %ifdefH. Peter Anvin (Intel)2020-06-051-0/+7
| | | | | | For some reason, %ifdef is failing now?! Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: commas inside parens don't break macro argumentsH. Peter Anvin2020-06-041-2/+2
| | | | | | | | | Legacy NASM behavior is (quite frankly the sane one) that a comma inside a set of parentheses do not split smacro arguments, unless explicitly using braces to enforce this behavior. Revert to legacy behavior, which again, is arguably the more correct. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* BR 3392676: fix cmpxchg8b/16b with explicit sizeH. Peter Anvin (Intel)2020-06-041-2/+2
| | | | | | | CMPXCHG8b/16b should be legitimate with an explicit operand size. Reported-by: Xusheng Li <xushengli@protonmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc5nasm-2.15rc5H. Peter Anvin (Intel)2020-06-041-1/+1
|
* Makefile.in: always_everything needs to depend on dirsH. Peter Anvin (Intel)2020-06-041-1/+2
| | | | | | If the directories don't exist, we could get serious weirdness. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* Makefile.in: Makefile.dep is not optional for external dependenciesnasm-2.15rc4H. Peter Anvin (Intel)2020-06-041-2/+2
| | | | | | | | If we have external dependencies, we need Makefile.dep to exist; this forces make to invoke the Makefile.dep target if this file is missing. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc4H. Peter Anvin (Intel)2020-06-041-1/+1
|
* mkdep.pl: remove debugging print statementH. Peter Anvin (Intel)2020-06-041-2/+0
| | | | | | Remove debugging print statement. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* Makefile: run cleandeps, no need to config.status --recheckH. Peter Anvin (Intel)2020-06-043-14/+4
| | | | | | | There is no point to run config.status --recheck just because we have changed Makefile.in. Just run config.status. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* mkdep.pl: fix internalization/externalizationH. Peter Anvin (Intel)2020-06-041-8/+15
| | | | | | | At some point internalization/externalization of dependencies apparently broke. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* release: don't include nasmdoc.pdf.xz in the -xdoc fileH. Peter Anvin (Intel)2020-06-041-1/+2
| | | | | | | There is no reason to include both nasmdoc.pdf.xz and nasmdoc.pdf. For the -xdoc file, the one with minimal dependencies is the proper one. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* nasm.spec.in: need perl; .pdf.xz now build by standard MakefileH. Peter Anvin (Intel)2020-06-041-2/+2
| | | | | | | | | Building NASM from scratch needs perl. .pdf.xz is now build by the standard NASM Makefile.in, so don't do it again (it causes failures.) Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc3nasm-2.15rc3H. Peter Anvin (Intel)2020-06-041-1/+1
|
* BR 3392662: handle empty argument at end of mmacro callH. Peter Anvin (Intel)2020-06-041-3/+10
| | | | | | | | | | | A trailing comma at the end of an mmacro call is an empty argument, and so we can't terminate the argument-processing loop. The only case where skip_white() returning NULL where we are allowed to terminate the loop is in the case of nparams == 0, i.e. the macro call has no arguments at all. Reported-by: gabriele balducci <balducci@units.it> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* nasm.c: correctly print errors once committed; assert errhold_stack emptyH. Peter Anvin (Intel)2020-06-041-5/+10
| | | | | | | | | | Properly format the error messages when we print them (oops!) The errhold_stack should be empty after each pass. It may even be worthwhile to make sure it is empty after each *line*, but do this for now. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: don't call nasm_error_hold_push() twiceH. Peter Anvin (Intel)2020-06-041-1/+0
| | | | | | | We must not call nasm_error_hold_push() twice... the obvious leak of the error stack caused all kinds of errors to be suppressed. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* BR 3392652: hold smacro expansion warnings until we are sureH. Peter Anvin (Intel)2020-06-044-37/+157
| | | | | | | | Don't issue smacro expansion warnings until we are sure we are actually *done* with the smacro expansion. The last pass of expand_smacro_noreset() gets to commit warnings. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* asm/error.c: handle warning "all" correctlyH. Peter Anvin (Intel)2020-06-041-2/+6
| | | | | | | | warning_alias[0] is "all". It is represented in the loop by value == NULL; WARN_IDX_ALL does not have an entry in warning_state[] and so trying to poke it is an error. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* NASM 2.15rc2nasm-2.15rc2H. Peter Anvin2020-06-011-1/+1
|
* outobj: fix harmless but still incorrect use of uninitialized variableH. Peter Anvin2020-06-011-3/+3
| | | | | | | Fix use of uninitialized variable. This most likely is just an issue while running at debug level >= 3, but it's still wrong. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* BR 3392674: fix handling of {ud1,ud2b} <reg>,<reg>H. Peter Anvin2020-06-011-6/+6
| | | | | | | | We need the instruction table to contain the correct information for both the reg and the rm field in the various modes. Reported-by: <fasdfqwer@mail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* BR 3392667: more reasonable limit for expression descentH. Peter Anvin (Intel)2020-06-018-5/+113
| | | | | | | | Set an expression descent limit to 8192, which is more reasonable to expect to work on most platforms. Furthermore, if getrlimit() exists, then try to use it to see if we need to further limit the size. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* preproc: error out if an include file exists but can't be openedH. Peter Anvin (Intel)2020-06-013-6/+12
| | | | | | | | | | If an include file exists, but cannot be opened, that is still a critical error. However, downgrade this from a fatal to a nonfatal error. There really isn't any reason to stop cold here. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* BR 3392669: in expand_one_smacro(), we may reach EOL before tafterH. Peter Anvin (Intel)2020-06-012-1/+1
| | | | | | | | | If the rest of the line is consumed, we may never see tafter, so we have to test for end of line at line 5412. We already do at 5397, so it clearly should have been there all along. Reported-by: <puppet@zju.edu.cn> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>