mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-03 08:41:02 +08:00
Merge branch 'nasm-2.14.xx'
* nasm-2.14.xx: Fix undefined behavior when shifting left by 32 bits BR 3392529: if the default output name is the same as input -> nasm.out
This commit is contained in:
commit
744100dc14
@ -556,7 +556,7 @@ static bool ieee_flconvert_bin(const char *string, int bits,
|
||||
mp = &mult[MANT_LIMBS]; /* Guard slot */
|
||||
ms += LIMB_BITS;
|
||||
}
|
||||
*mp |= v << ms;
|
||||
*mp |= v << (ms % (sizeof(fp_limb) * CHAR_BIT));
|
||||
ms -= bits;
|
||||
|
||||
if (!seendot)
|
||||
|
11
asm/nasm.c
11
asm/nasm.c
@ -520,9 +520,14 @@ int main(int argc, char **argv)
|
||||
* is a preprocess mode, we're perfectly
|
||||
* fine to output into stdout.
|
||||
*/
|
||||
if (!outname) {
|
||||
if (!(operating_mode & OP_PREPROCESS))
|
||||
outname = filename_set_extension(inname, ofmt->extension);
|
||||
if (!outname && !(operating_mode & OP_PREPROCESS)) {
|
||||
outname = filename_set_extension(inname, ofmt->extension);
|
||||
if (!strcmp(outname, inname)) {
|
||||
outname = "nasm.out";
|
||||
nasm_error(ERR_WARNING,
|
||||
"default output file same as input, using `%s' for output\n",
|
||||
inname, outname);
|
||||
}
|
||||
}
|
||||
|
||||
if (depend_file || (operating_mode & OP_DEPEND))
|
||||
|
Loading…
Reference in New Issue
Block a user