Skip to content

Commit

Permalink
Suggested fix from Radford Neal
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Nov 17, 2014
1 parent dfa4208 commit 4a1fd29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/reassign.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ SEXP reassign_function(SEXP name, SEXP env, SEXP old_fun, SEXP new_fun)
if (TYPEOF(old_fun) != CLOSXP) error("old_fun must be a function");
if (TYPEOF(new_fun) != CLOSXP) error("new_fun must be a function");

FORMALS(old_fun) = FORMALS(new_fun);
BODY(old_fun) = BODY(new_fun);
CLOENV(old_fun) = CLOENV(new_fun);
SET_FORMALS(old_fun, FORMALS(new_fun));
SET_BODY(old_fun, BODY(new_fun));
SET_CLOENV(old_fun, CLOENV(new_fun));
DUPLICATE_ATTRIB(old_fun, new_fun);

return R_NilValue;
Expand Down

0 comments on commit 4a1fd29

Please sign in to comment.