Project

General

Profile

« Previous | Next » 

Revision c41af37e

Added by alanwu (Alan Wu) about 1 year ago

[ruby/io-console] Read errno before calling rb_io_path()

Possible fix for recent crashes seen on CI.

 [BUG] rb_sys_fail_str(<STDIN>) - errno == 0

rb_io_path() calls rb_obj_dup(), which could call initialize_dup in Ruby
and clobber errno before rb_sys_fail_str() gets to read errno. So
save it out first.

(Using separate statements because order of evaluation in function call
list is unspecified, and order is important here.)

https://github.com/ruby/io-console/commit/0ba400b5e7