MilesCranmer commited on
Commit
b7257cc
1 Parent(s): 85aeb48

Fix stackoverflow error from missing copy

Browse files
Files changed (1) hide show
  1. julia/sr.jl +1 -1
julia/sr.jl CHANGED
@@ -424,7 +424,7 @@ function prependRandomOp(tree::Node)::Node
424
  node = tree
425
  choice = rand()
426
  makeNewBinOp = choice < nbin/nops
427
- left = tree
428
 
429
  if makeNewBinOp
430
  right = randomConstantNode()
 
424
  node = tree
425
  choice = rand()
426
  makeNewBinOp = choice < nbin/nops
427
+ left = copyNode(tree)
428
 
429
  if makeNewBinOp
430
  right = randomConstantNode()