[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 279938] KDevelop crashes with infinite loop in recursive macros
From:       Leonardo <leonardo.guilherme () gmail ! com>
Date:       2011-08-12 20:43:21
Message-ID: E1QryZd-00035u-Gy () bugs ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=279938





--- Comment #1 from Leonardo <leonardo guilherme gmail com>  2011-08-12 20:43:21 ---
Ok, I decided to understand the macros and found that

FILE(GLOB files RELATIVE ${srcDir} ${srcDir}/*)

returns nothing on ${files}, as if ${srcDir} was empty. It isn't, so I assume
this  is intended behaviour, but then, below, there is a

FOREACH(file ${files})

and there's where the problem happens. It shouldn't enter in this FOREACH
because ${files} is supposed to be empty.

Inside that foreach, in 
SET(srcPath ${srcDir}/${file})
SET(destPath ${destDir}/${file})

srcPath becomes the original ${srcDir} with a / appended to it.

IF(NOT IS_DIRECTORY ${srcPath})
 CONFIGURE_FILE(${srcPath} ${destPath} COPYONLY)
ELSE(NOT IS_DIRECTORY ${srcPath})
 CONFIGURE_FILES(${srcPath} ${destPath})
ENDIF(NOT IS_DIRECTORY ${srcPath})

it always go into that else because ${srcPath} is a directory, a valid one
because a lot of / appended in the end of the directory still makes it valid.
And then it calls CONFIGURE_FILES, the same macro, creating the infinite loop.

Something is wrong here, either FILE returning empty list of files or the
foreach looping in a empty variable. Those macros works ok in CMake.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic