mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-06 16:04:43 +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 */
|
mp = &mult[MANT_LIMBS]; /* Guard slot */
|
||||||
ms += LIMB_BITS;
|
ms += LIMB_BITS;
|
||||||
}
|
}
|
||||||
*mp |= v << ms;
|
*mp |= v << (ms % (sizeof(fp_limb) * CHAR_BIT));
|
||||||
ms -= bits;
|
ms -= bits;
|
||||||
|
|
||||||
if (!seendot)
|
if (!seendot)
|
||||||
|
@ -520,9 +520,14 @@ int main(int argc, char **argv)
|
|||||||
* is a preprocess mode, we're perfectly
|
* is a preprocess mode, we're perfectly
|
||||||
* fine to output into stdout.
|
* fine to output into stdout.
|
||||||
*/
|
*/
|
||||||
if (!outname) {
|
if (!outname && !(operating_mode & OP_PREPROCESS)) {
|
||||||
if (!(operating_mode & OP_PREPROCESS))
|
|
||||||
outname = filename_set_extension(inname, ofmt->extension);
|
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))
|
if (depend_file || (operating_mode & OP_DEPEND))
|
||||||
|
Loading…
Reference in New Issue
Block a user