]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r258779,r258780,r258787,r258822:
authoreadler <eadler@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 4 Feb 2014 03:36:42 +0000 (03:36 +0000)
committereadler <eadler@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 4 Feb 2014 03:36:42 +0000 (03:36 +0000)
commit4dae526afadd932e64668d0bef665bf002fb762d
tree7e76e370b9406b0383b17bd343084addb4ad6a25
parent9dd1cd2fc91d01ff5a20a450464eaba62e2cefb4
MFC r258779,r258780,r258787,r258822:

Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

Similar to the (1 << 31) case it is not defined to do (2 << 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@261455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
110 files changed:
lib/libc/sparc64/fpu/fpu.c
lib/libc/sparc64/fpu/fpu_sqrt.c
lib/libc/xdr/xdr_rec.c
sys/amd64/pci/pci_cfgreg.c
sys/amd64/vmm/intel/vmcs.h
sys/amd64/vmm/intel/vmx_controls.h
sys/amd64/vmm/intel/vtd.c
sys/arm/arm/cpufunc_asm_pj4b.S
sys/arm/arm/db_trace.c
sys/arm/arm/pl190.c
sys/arm/at91/if_macbvar.h
sys/arm/broadcom/bcm2835/bcm2835_dma.c
sys/arm/econa/if_ece.c
sys/arm/freescale/imx/imx6_anatopreg.h
sys/arm/freescale/imx/imx6_usbphy.c
sys/arm/freescale/imx/imx_gptreg.h
sys/arm/include/armreg.h
sys/arm/lpc/if_lpereg.h
sys/arm/lpc/lpcreg.h
sys/arm/mv/mv_pci.c
sys/arm/samsung/exynos/ehci_exynos5.c
sys/arm/xscale/i8134x/i81342reg.h
sys/arm/xscale/ixp425/ixp425reg.h
sys/boot/arm/at91/libat91/mci_device.h
sys/boot/i386/libfirewire/fwohci.h
sys/boot/i386/libfirewire/fwohcireg.h
sys/dev/aac/aacvar.h
sys/dev/acpica/acpi_video.c
sys/dev/agp/agp_i810.c
sys/dev/ahci/ahci.h
sys/dev/bktr/bktr_core.c
sys/dev/cesa/cesa.h
sys/dev/drm/i915_reg.h
sys/dev/drm/mach64_drv.h
sys/dev/drm/mga_drv.h
sys/dev/drm/r128_drv.h
sys/dev/drm/r300_reg.h
sys/dev/drm/r600_blit.c
sys/dev/drm/radeon_cp.c
sys/dev/drm/radeon_drv.h
sys/dev/drm/via_irq.c
sys/dev/drm2/i915/i915_reg.h
sys/dev/drm2/radeon/evergreen_blit_kms.c
sys/dev/drm2/radeon/evergreen_cs.c
sys/dev/drm2/radeon/evergreend.h
sys/dev/drm2/radeon/nid.h
sys/dev/drm2/radeon/r200.c
sys/dev/drm2/radeon/r300.c
sys/dev/drm2/radeon/r300_reg.h
sys/dev/drm2/radeon/r500_reg.h
sys/dev/drm2/radeon/r600_blit.c
sys/dev/drm2/radeon/r600_blit_kms.c
sys/dev/drm2/radeon/r600_cs.c
sys/dev/drm2/radeon/r600d.h
sys/dev/drm2/radeon/radeon_cp.c
sys/dev/drm2/radeon/radeon_drv.h
sys/dev/drm2/radeon/radeon_reg.h
sys/dev/drm2/radeon/rv770d.h
sys/dev/drm2/radeon/sid.h
sys/dev/drm2/ttm/ttm_bo.c
sys/dev/e1000/e1000_82575.h
sys/dev/e1000/e1000_ich8lan.c
sys/dev/e1000/e1000_regs.h
sys/dev/etherswitch/arswitch/arswitchreg.h
sys/dev/ffec/if_ffecreg.h
sys/dev/firewire/firewire.c
sys/dev/firewire/fwohci.c
sys/dev/firewire/fwohcireg.h
sys/dev/firewire/sbp.c
sys/dev/firewire/sbp.h
sys/dev/firewire/sbp_targ.c
sys/dev/hatm/if_hatmreg.h
sys/dev/hwpmc/hwpmc_piv.h
sys/dev/iwn/if_iwnreg.h
sys/dev/mge/if_mgevar.h
sys/dev/mpt/mpt_cam.c
sys/dev/msk/if_mskreg.h
sys/dev/mvs/mvs.h
sys/dev/mxge/mxge_mcp.h
sys/dev/qlxge/qls_dump.c
sys/dev/ral/rt2560reg.h
sys/dev/ral/rt2661reg.h
sys/dev/ral/rt2860reg.h
sys/dev/sound/pci/hda/hdaa.h
sys/dev/usb/controller/ehci.h
sys/dev/usb/wlan/if_rumreg.h
sys/dev/usb/wlan/if_runreg.h
sys/dev/usb/wlan/if_uralreg.h
sys/dev/usb/wlan/if_urtwreg.h
sys/dev/usb/wlan/if_zydreg.h
sys/dev/wpi/if_wpireg.h
sys/geom/raid/tr_raid1e.c
sys/i386/pci/pci_cfgreg.c
sys/mips/atheros/ar71xxreg.h
sys/mips/atheros/ar934xreg.h
sys/mips/atheros/if_argevar.h
sys/mips/malta/gt_pci.c
sys/mips/nlm/dev/net/nae.c
sys/mips/nlm/xlp_machdep.c
sys/mips/rmi/pic.h
sys/ofed/drivers/infiniband/hw/mlx4/qp.c
sys/ofed/drivers/infiniband/hw/mthca/mthca_mcg.c
sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c
sys/ofed/drivers/net/mlx4/mcg.c
sys/powerpc/fpu/fpu_emu.c
sys/powerpc/fpu/fpu_sqrt.c
sys/powerpc/powermac/nvbl.c
sys/sys/consio.h
sys/x86/iommu/intel_reg.h
usr.sbin/bluetooth/bthidd/kbd.c