Skip to content

Commit 5df4484

Browse files
committed
Remove the exception from the extractString method
We assumed that the `pm_string_t` objects being passed as arguments to this method would need to be freed from memory, but because they are all referenced by nodes in the Prism AST, they will be freed once the tree is destroyed.
1 parent c284c31 commit 5df4484

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

parser/prism/Parser.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ std::string_view Parser::resolveConstant(pm_constant_id_t constant_id) {
2525
}
2626

2727
std::string_view Parser::extractString(pm_string_t *string) {
28-
if (string->type != pm_string_t::PM_STRING_CONSTANT && string->type != pm_string_t::PM_STRING_SHARED) {
29-
Exception::raise(
30-
"This string needs to be freed eventually with `pm_string_free`, but that isn't implemented yet");
31-
}
32-
3328
return std::string_view(reinterpret_cast<const char *>(pm_string_source(string)), pm_string_length(string));
3429
}
3530

0 commit comments

Comments
 (0)