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:
Cyrill Gorcunov 2018-11-23 23:52:11 +03:00
commit 744100dc14
2 changed files with 9 additions and 4 deletions

View File

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

View File

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