Project

General

Profile

Actions

Bug #20322

closed

rb_enc_interned_str_cstr doesn't accept null pointer for encoding

Added by thomasmarshall (Thomas Marshall) 5 months ago. Updated 3 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:117037]

Description

The header documentation for rb_enc_interned_str_cstr notes:

enc can be a null pointer.

When adding support for this function to TruffleRuby we noticed that the behaviour did not match that documentation. I think this did work previously, but it currently causes a segmentation fault when trying to autoload the encoding because it calls rb_enc_mbmaxlen which expects a non-null encoding.

I'm not sure how important this behaviour is, whether extensions ever actually call this with a null pointer, or if the documentation is instead just incorrect. I think it's a straightforward fix to make the behaviour match the documentation, so I would like to open a PR, but also happy to just remove the note if that is preferable.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #18772: Backport edf01d4e82d8e44ee30ec41fbcb7f802bc8b8c5dClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0