Skip to content

Commit 812a3e4

Browse files
committed
[hlc] prevent recursive template/code copy
1 parent e8c9014 commit 812a3e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

other/haxelib/Run.hx

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ class Build {
6767
if( !sys.FileSystem.exists(srcDir) )
6868
throw "Failed to find make template '"+tpl+"'";
6969
}
70-
70+
if( StringTools.contains(sys.FileSystem.absolutePath(targetDir), sys.FileSystem.absolutePath(srcDir)) ) {
71+
throw "Template "+tpl+" contains "+targetDir+", can cause recursive generation";
72+
}
73+
7174
var allFiles = config.files.copy();
7275
for( f in config.files )
7376
if( StringTools.endsWith(f,".c") ) {

0 commit comments

Comments
 (0)