Skip to content

Commit

Permalink
Merge pull request #698 from mame/do-not-depend-on-eval-order-of-args
Browse files Browse the repository at this point in the history
Do not depend on the evaluation order of C arguments
  • Loading branch information
hsbt authored Dec 4, 2024
2 parents 7c81f7d + d1e6bf3 commit 0eb96cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/psych/psych_emitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,12 @@ static VALUE scalar(
tag = rb_str_export_to_enc(tag, encoding);
}

const char *value_ptr = StringValuePtr(value);
yaml_scalar_event_initialize(
&event,
(yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
(yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
(yaml_char_t*)StringValuePtr(value),
(yaml_char_t*)value_ptr,
(int)RSTRING_LEN(value),
plain ? 1 : 0,
quoted ? 1 : 0,
Expand Down

0 comments on commit 0eb96cb

Please sign in to comment.