summaryrefslogtreecommitdiff
path: root/labels.c
AgeCommit message (Collapse)AuthorFilesLines
2010-07-28labels.c: cleanupCyrill Gorcunov1-90/+77
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-21labels.c: lookup_label -- should return bool unconditionallyCyrill Gorcunov1-2/+3
Better to not put return under condition. It was bad. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-02-18labels.c: Fix NULL dereference on too long identifiersCyrill Gorcunov1-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>
2009-08-11Fix some format strings for nasm_errorVictor van den Elzen1-2/+2
Added a format attribute to nasm_error (only for GCC) and used the resulting warnings to fix some format strings.
2009-07-18Drop the ofmt and errfunc arguments to label definition functionsH. Peter Anvin1-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>
2009-07-06NASM: relicense under the 2-clause BSD licenseH. Peter Anvin1-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>
2009-07-05BR 2817225: don't overrun a permts buffer with a maximum labelH. Peter Anvin1-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>
2009-06-28Add copyright headers to the *.c/*.h files in the main directoryH. Peter Anvin1-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>
2009-06-27BR 2781900: handle common labels while optimizingH. Peter Anvin1-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>
2009-01-28Allow global declaration after symbol definitionCharles Crayne1-3/+5
This experimental feature needs to be tested for all output formats which recognize global symbols.
2009-01-27Fix Bugs item #2537867Charles Crayne1-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.
2008-09-11Halt assembly if addresses are not converging.Charles Crayne1-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.
2008-06-04Remove EQU for critical expression listCharles Crayne1-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.
2008-05-28hash user allocates struct hash_tableH. Peter Anvin1-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.
2008-05-22Use hash tables even for context-sensitive macrosH. Peter Anvin1-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.
2008-03-12Display fully qualified local label in "not defined" messageCharles Crayne1-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.
2008-03-03Eliminate duplicate symbol definitionsCharles Crayne1-1/+1
Don't accept -1 as an odd numbered segment
2007-12-29regularized spelling of license to match name of LICENSE fileBeroset1-1/+1
2007-11-05Upgrade label functions to 64-bitCharles Crayne1-5/+7
2007-10-19Formatting: kill off "stealth whitespace"H. Peter Anvin1-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.
2007-10-11Additional uses of bool and enumH. Peter Anvin1-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.
2007-10-10Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin1-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.
2007-10-02Portability fixesH. Peter Anvin1-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.)
2007-09-16Switch the preprocessor over to using the hash table libraryH. Peter Anvin1-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.
2007-09-16Fix the handling of local labelsH. Peter Anvin1-22/+11
In converting the label system over to the new hash table library, accidentally broke local labels by prepending the prefix twice. Fix.
2007-09-14Use the new hash table function library to store labelsH. Peter Anvin1-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.
2007-04-13Fixed distinction between char and int8_t data types.Keith Kanios1-19/+19
2007-04-12General push for x86-64 support, dubbed 0.99.00.Keith Kanios1-26/+28
2005-01-15Apply Nindent to all .c and .h filesH. Peter Anvin1-149/+161
2004-12-15changed sprintf to more secure snprintf to prevent vulnerability to bufferEd Beroset1-2/+2
overflow exploits.
2003-09-08fixed bug #677841 by limiting the scanner to no more than 4095 characters ↵Ed Beroset1-0/+3
for a single ID token
2002-04-30NASM 0.98.09H. Peter Anvin1-5/+0
2002-04-30NASM 0.98.08H. Peter Anvin1-18/+92
2002-04-30NASM 0.98.03H. Peter Anvin1-114/+123
2002-04-30NASM 0.98H. Peter Anvin1-6/+8
2002-04-30NASM 0.98p3H. Peter Anvin1-17/+100
2002-04-30NASM 0.96H. Peter Anvin1-33/+54
2002-04-30NASM 0.95H. Peter Anvin1-2/+4
2002-04-30NASM 0.94H. Peter Anvin1-0/+2
2002-04-30NASM 0.91H. Peter Anvin1-0/+292