summaryrefslogtreecommitdiff
path: root/labels.c
Commit message (Collapse)AuthorAgeFilesLines
* labels.c: cleanupCyrill Gorcunov2010-07-281-90/+77
| | | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* labels.c: lookup_label -- should return bool unconditionallyCyrill Gorcunov2010-04-211-2/+3
| | | | | | Better to not put return under condition. It was bad. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* labels.c: Fix NULL dereference on too long identifiersCyrill Gorcunov2010-02-181-1/+10
| | | | | | | | | | In case if label is local and exceed maximum allowed length we get NULL dereference. Fix it and warn a user about an accident. Note that we don't print identifier itself since we know it's too big. Line number of error is enough. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* Fix some format strings for nasm_errorVictor van den Elzen2009-08-111-2/+2
| | | | | Added a format attribute to nasm_error (only for GCC) and used the resulting warnings to fix some format strings.
* Drop the ofmt and errfunc arguments to label definition functionsH. Peter Anvin2009-07-181-16/+13
| | | | | | | | We never set ofmt and errfunc to anything but the global values. Dropping them from the label definition function command line simplifies the code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* NASM: relicense under the 2-clause BSD licenseH. Peter Anvin2009-07-061-12/+0
| | | | | | | | *To the best of my knowledge*, we now have authorization from everyone who has significantly contributed to NASM in the past. As such, change the license to the 2-clause BSD license. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* BR 2817225: don't overrun a permts buffer with a maximum labelH. Peter Anvin2009-07-051-3/+5
| | | | | | | | | | BR 677841 was fixed backwards, with a reverse condition. Correct the direction of the fix, and add an assert for the overflow condition. Note: the bug was non-manifest in previous build, so this is not a security issue. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add copyright headers to the *.c/*.h files in the main directoryH. Peter Anvin2009-06-281-5/+46
| | | | | | | | | | Add copyright headers to the *.c/*.h files in the main directory. For files where I'm sure enough that we have all the approvals, I have given them the 2-BSD license, the others have been given the "LGPL for now" license header. Most of them can probably be changed after auditing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* BR 2781900: handle common labels while optimizingH. Peter Anvin2009-06-271-15/+25
| | | | | | | | | | | When optimizing, we have to keep track of common labels, since a common symbol cannot be optimized -- only the linker will know where it will end up. In that sense it is similar to an EXTERN symbol. Thus, allow them to be entered in the symbol table but make sure we don't holler too hard on redefinition. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Allow global declaration after symbol definitionCharles Crayne2009-01-281-3/+5
| | | | | This experimental feature needs to be tested for all output formats which recognize global symbols.
* Fix Bugs item #2537867Charles Crayne2009-01-271-1/+1
| | | | | | Module labels.c has code to issue error message when global directive appears after symbol definition, but the test condition was incorrectly punctuated.
* Halt assembly if addresses are not converging.Charles Crayne2008-09-111-2/+2
| | | | | | | | Change global_offset_changed from bool to int so that progress of convergence can be monitored. If change count does not decrease from previous pass, increment stall counter. If stall count reaches threshold, terminate assembly with error message.
* Remove EQU for critical expression listCharles Crayne2008-06-041-1/+1
| | | | | | Allow redefine_label to update segment as well as offset, thereby fixing bug which required EQU to be on the critical expression list.
* hash user allocates struct hash_tableH. Peter Anvin2008-05-281-4/+4
| | | | | | | | | | | struct hash_table, a fixed-sized structure, is now allocated by the caller. This lets us integrate it into the Context structure, thus avoiding an additional dynamically allocated object for no good reason. Add some minor code collapsing: make it more obvious that all that differs is a pointer value, rather than relying on the compiler to do tail merging.
* Use hash tables even for context-sensitive macrosH. Peter Anvin2008-05-221-1/+1
| | | | | | | | | | | Normally, contexts aren't used with a large number of macros, but in case someone does, do use hash tables for those as well. This simplifies the code somewhat, since *all* handling of macros is now done via hash tables. Future note: consider if it wouldn't be better to allow struct hash_table to be allocated by the caller, instead of being allocated by the hash table routine.
* Display fully qualified local label in "not defined" messageCharles Crayne2008-03-121-0/+5
| | | | | | | Add new function "local_scope" to label subsystem to return the previous non-local label for a given local label, and invoke this funcion in eval.c to display the fully qualified name in the "not defined" error message.
* Eliminate duplicate symbol definitionsCharles Crayne2008-03-031-1/+1
| | | | Don't accept -1 as an odd numbered segment
* regularized spelling of license to match name of LICENSE fileBeroset2007-12-291-1/+1
|
* Upgrade label functions to 64-bitCharles Crayne2007-11-051-5/+7
|
* Formatting: kill off "stealth whitespace"H. Peter Anvin2007-10-191-2/+2
| | | | | "Stealth whitespace" makes it harder to read diffs, and just generally cause unwanted weirdness. Do a source-wide pass to get rid of it.
* Additional uses of bool and enumH. Peter Anvin2007-10-111-14/+11
| | | | | | Proper use of bool and enum makes code easier to debug. Do more of it. In particular, we really should stomp out any residual uses of magic constants that aren't enums or, in some cases, even #defines.
* Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin2007-10-101-4/+4
| | | | | | | Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
* Portability fixesH. Peter Anvin2007-10-021-0/+2
| | | | | | | | | Concentrate compiler dependencies to compiler.h; make sure compiler.h is included first in every .c file (since some prototypes may depend on the presence of feature request macros.) Actually use the conditional inclusion of various functions (totally broken in previous releases.)
* Switch the preprocessor over to using the hash table libraryH. Peter Anvin2007-09-161-2/+3
| | | | | | | | | | | Switch the preprocessor over to using the hash table library. On my system, this improves the runtime of the output of test/pref/macro.pl from over 600 seconds to 7 seconds. Macros have an odd mix of case-sensitive and case-insensitive behaviour, plus there are matching parameters for arguments, etc. As a result, we use case-insensitive hash tables and use a linked list to store all the possible isomorphs.
* Fix the handling of local labelsH. Peter Anvin2007-09-161-22/+11
| | | | | In converting the label system over to the new hash table library, accidentally broke local labels by prepending the prefix twice. Fix.
* Use the new hash table function library to store labelsH. Peter Anvin2007-09-141-68/+62
| | | | | | Use the new hash table function library to store labels. When compiling on my 64-bit system, it reduces the assembly time for the output of test/perf/label.pl from 73 to 7 seconds.
* Fixed distinction between char and int8_t data types.Keith Kanios2007-04-131-19/+19
|
* General push for x86-64 support, dubbed 0.99.00.Keith Kanios2007-04-121-26/+28
|
* Apply Nindent to all .c and .h filesnasm-0.98.39LATESTH. Peter Anvin2005-01-151-149/+161
|
* changed sprintf to more secure snprintf to prevent vulnerability to bufferEd Beroset2004-12-151-2/+2
| | | | overflow exploits.
* fixed bug #677841 by limiting the scanner to no more than 4095 characters ↵Ed Beroset2003-09-081-0/+3
| | | | for a single ID token
* NASM 0.98.09nasm-0.98.09H. Peter Anvin2002-04-301-5/+0
|
* NASM 0.98.08nasm-0.98.08H. Peter Anvin2002-04-301-18/+92
|
* NASM 0.98.03nasm-0.98.03H. Peter Anvin2002-04-301-114/+123
|
* NASM 0.98nasm-0.98fork-0.98bfH. Peter Anvin2002-04-301-6/+8
|
* NASM 0.98p3nasm-0.98p3H. Peter Anvin2002-04-301-17/+100
|
* NASM 0.96nasm-0.96H. Peter Anvin2002-04-301-33/+54
|
* NASM 0.95nasm-0.95H. Peter Anvin2002-04-301-2/+4
|
* NASM 0.94nasm-0.94H. Peter Anvin2002-04-301-0/+2
|
* NASM 0.91nasm-0.91H. Peter Anvin2002-04-301-0/+292