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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>