Skip to content

Commit

Permalink
Merge ""Fix undefined left shifting of negative numbers" (#338) to hd…
Browse files Browse the repository at this point in the history
…f5_1_ 8 (#371)

* close #195. (#196)

* Update HDF5PluginMacros.cmake

* Update HDF5PluginMacros.cmake

* Restores maintainer mode in the autotools (#200)

Maintainer mode should be enabled in development branches.

Also adds helpful commenting.

Add script bin/switch_maint_mode.

Add file changes generated by bin reconfigure in
    src/H5Edefin.h
    src/H5Einit.h
    src/H5Epubgen.h
    src/H5Eterm.h

* Update MANIFEST for switch_maint_mode.

* Update so numbers to match 1.8.22 release.

* Updated configure with reconfigure.

* Updates and corrections following HDF5 1.8.22 release.

* Commit Makefile.ins with so version numbers updated by bin/reconfigure.

* Fix undefined left shifting of negative numbers (#338)

Undefined Bahavior Sanitizer errored here about left shifting negative numbers.

Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Co-authored-by: Sean McBride <sean@rogue-research.com>
  • Loading branch information
4 people authored Feb 23, 2021
1 parent df1a4af commit d1475f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -3760,7 +3760,7 @@ test_nbit_compound_2(hid_t file)
power = HDpow(2.0F, (double)(precision[1] - 1));
orig_data[i][j].a.c = (char)(((long long)HDrandom() % (long long)power) << offset[1]);
power = HDpow(2.0F, (double)(precision[2] - 1));
orig_data[i][j].a.s = (short)(-((long long)HDrandom() % (long long)power) << offset[2]);
orig_data[i][j].a.s = (short)(-(((long long)HDrandom() % (long long)power) << offset[2]));
orig_data[i][j].a.f = float_val[i][j];

power = HDpow(2.0F, (double)precision[3]);
Expand All @@ -3776,7 +3776,7 @@ test_nbit_compound_2(hid_t file)
for (n = 0; n < (size_t)array_dims[1]; n++) {
power = HDpow(2.0F, (double)(precision[0] - 1));
orig_data[i][j].d[m][n].i =
(int)(-((long long)HDrandom() % (long long)power) << offset[0]);
(int)(-(((long long)HDrandom() % (long long)power) << offset[0]));
power = HDpow(2.0F, (double)(precision[1] - 1));
orig_data[i][j].d[m][n].c =
(char)(((long long)HDrandom() % (long long)power) << offset[1]);
Expand Down

0 comments on commit d1475f5

Please sign in to comment.