Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -7449,11 +7449,7 @@ SEXP R_igraph_from_prufer(SEXP prufer) {

SEXP r_result;
/* Convert input */
if (!Rf_isNull(prufer)) {
R_SEXP_to_vector_int_copy(prufer, &c_prufer);
} else {
IGRAPH_R_CHECK(igraph_vector_int_init(&c_prufer, 0));
}
R_SEXP_to_vector_int_copy(prufer, &c_prufer);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this also needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Input argument in this function couldn't be NULL

IGRAPH_FINALLY(igraph_vector_int_destroy, &c_prufer);
/* Call igraph */
IGRAPH_R_CHECK(igraph_from_prufer(&c_graph, &c_prufer));
Expand Down
36 changes: 32 additions & 4 deletions tools/stimulus/types-RC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,18 @@ INDEX_VECTOR:
CALL: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: R_SEXP_to_vector_int_copy(%I%, &%C%);
IN: |-
R_SEXP_to_vector_int_copy(%I%, &%C%);
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUTCONV:
IN: |-
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
OUT: |-
PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%));
igraph_vector_int_destroy(&%C%);
Expand Down Expand Up @@ -196,13 +201,18 @@ VECTOR_INT:
CALL: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: R_SEXP_to_vector_int_copy(%I%, &%C%);
IN: |-
R_SEXP_to_vector_int_copy(%I%, &%C%);
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUTCONV:
IN: |-
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
OUT: |-
PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%));
igraph_vector_int_destroy(&%C%);
Expand Down Expand Up @@ -657,13 +667,22 @@ VERTEX_COLOR:
OUT: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_int_copy(%I%, &%C%); }
IN: |-
if (!Rf_isNull(%I%)) {
R_SEXP_to_vector_int_copy(%I%, &%C%);
} else {
IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0));
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUTCONV:
IN: |-
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
OUT: |-
PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%));
igraph_vector_int_destroy(&%C%);
Expand All @@ -675,13 +694,22 @@ EDGE_COLOR:
OUT: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_int_copy(%I%, &%C%); }
IN: |-
if (!Rf_isNull(%I%)) {
R_SEXP_to_vector_int_copy(%I%, &%C%);
} else {
IGRAPH_R_CHECK(igraph_vector_int_init(&%C%, 0));
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
IGRAPH_FINALLY(igraph_vector_int_destroy, &%C%);
OUTCONV:
IN: |-
igraph_vector_int_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1);
OUT: |-
PROTECT(%I%=R_igraph_vector_int_to_SEXP(&%C%));
igraph_vector_int_destroy(&%C%);
Expand Down