HomeFreeBSD

kern_ntptime: Fix undefined behavior of the shift operator

Description

kern_ntptime: Fix undefined behavior of the shift operator

L_LINT macro is used with negative numbers [i.e.
L_LINT(time_freq, -MAXFREQ)], it could cause undefined
behavior. It should be similar to the L_RSHIFT(v, n) macro.

MFC after: 2 weeks
Reviewed by: cy
Pull Request: https://github.com/freebsd/freebsd-src/pull/769
Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com>
(cherry picked from commit af9ce4e9bb7d717279e02d46455e85ef6fb828f7)

Details

Provenance
Dmitriy Alexandrov <d06alexandrov@users.noreply.github.com>Authored on Jun 8 2023, 9:08 AM
cyCommitted on Jun 23 2023, 4:35 AM
Parents
rGf651a3f8ff0b: msun: Correct FreeBSD version in sincos() man page
Branches
Unknown
Tags
Unknown

Event Timeline

cy committed rGe66b677c9745: kern_ntptime: Fix undefined behavior of the shift operator (authored by Dmitriy Alexandrov <d06alexandrov@users.noreply.github.com>).Jun 23 2023, 4:35 AM