Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions prism_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -7164,9 +7164,16 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
// is popped, then we know we don't need to do anything since it's
// statically known.
if (!popped) {
VALUE value = pm_static_literal_value(iseq, node, scope_node);
PUSH_INSN1(ret, location, duphash, value);
RB_OBJ_WRITTEN(iseq, Qundef, value);
const pm_hash_node_t *cast = (const pm_hash_node_t *) node;

if (cast->elements.size == 0) {
PUSH_INSN1(ret, location, newhash, INT2FIX(0));
}
else {
VALUE value = pm_static_literal_value(iseq, node, scope_node);
PUSH_INSN1(ret, location, duphash, value);
RB_OBJ_WRITTEN(iseq, Qundef, value);
}
}
}
else {
Expand Down