6d163ef31c (master): prism: Work around VS2017 miscompilation of conditional expressions

0 views
Skip to first unread message

Hiroshi SHIBATA

unread,
Aug 3, 2026, 8:13:38 PM (16 hours ago) Aug 3
to ruby...@g.ruby-lang.org
Hiroshi SHIBATA 2026-08-03 22:40:12 +0000 (Mon, 03 Aug 2026)

New Revision: 6d163ef31c

https://github.com/ruby/ruby/commit/6d163ef31c

Log:
prism: Work around VS2017 miscompilation of conditional expressions

cl 19.16 materializes both arms of a conditional expression whose arms
are struct compound literals before testing the condition, so NTOK2LOC
and similar macros dereference NULL tokens and crash, even with -Od.
Build pm_location_t via an inline function instead, whose arguments are
only evaluated on the selected branch.

Co-Authored-By: Claude Fable 5 <nor...@anthropic.com>

Modified files:
prism/prism.c
Reply all
Reply to author
Forward
0 new messages