Skip to content

Commit

Permalink
Pass port to lf_writable_copy
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Jan 22, 2023
1 parent edfb520 commit c3b642a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions org.lflang/src/org/lflang/generator/c/CReactionGenerator.java
Expand Up @@ -569,7 +569,7 @@ private static String generateInputVariablesInReaction(
inputName+"->value = NULL;", // Prevent payload from being freed.
"if ("+inputName+"->is_present) {",
" "+inputName+"->length = "+inputName+"->token->length;",
" "+inputName+"->token = lf_writable_copy((token_template_t*)self->_lf_"+inputName+");",
" "+inputName+"->token = lf_writable_copy((lf_port_base_t*)self->_lf_"+inputName+");",
" "+inputName+"->value = ("+types.getTargetType(inputType)+")"+inputName+"->token->value;",
"} else {",
" "+inputName+"->length = 0;",
Expand All @@ -592,7 +592,7 @@ private static String generateInputVariablesInReaction(
" if ("+inputName+"[i]->is_present) {",
" "+inputName+"[i]->length = "+inputName+"[i]->token->length;",
" token_template_t* _lf_input = (token_template_t*)self->_lf_"+inputName+"[i];",
" "+inputName+"[i]->token = lf_writable_copy(_lf_input);",
" "+inputName+"[i]->token = lf_writable_copy((lf_port_base_t*)_lf_input);",
" "+inputName+"[i]->value = ("+types.getTargetType(inputType)+")"+inputName+"[i]->token->value;",
" } else {",
" "+inputName+"[i]->length = 0;",
Expand Down

0 comments on commit c3b642a

Please sign in to comment.