Issue 64431 - dmake: SETDIR for percent targets uses dangling pointer
Summary: dmake: SETDIR for percent targets uses dangling pointer
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: dmake (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-17 10:25 UTC by unistein
Modified: 2013-08-07 15:34 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch for infer.c to fix the dangling pointer (341 bytes, patch)
2006-04-17 10:28 UTC, unistein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description unistein 2006-04-17 10:25:32 UTC
Example makefile:
-----------------
all .PHONY : sub-{a b}

sub-% .SETDIR=. .PHONY :
	% $(MAKE) do-$*

do-% .PHONY :
	@echo do-$*
-----------------

Whenever a rule for percent target with a SETDIR attribute gets invoked more
than one, dmake quits with this message:

dmake.exe:  Error: -- Unable to change to directory `x\/', target is [sub-b]

The directory part of this message is random, because the directory is
referenced using an already freed pointer.
Comment 1 Martin Hollmichel 2006-04-17 10:27:22 UTC
reassign
Comment 2 unistein 2006-04-17 10:28:09 UTC
Created attachment 35753 [details]
Patch for infer.c to fix the dangling pointer
Comment 3 quetschke 2006-04-17 15:28:52 UTC
I take it. Unfortunately this has to wait until CWS dmake43p01 is integrated
(which is in progress now.).
Comment 4 quetschke 2006-06-14 00:38:09 UTC
@unistein: Thank you for filing this issue and providing the solution. Short of
rewriting the .SETDIR handling your fix is the obvious solution. I committed
something comparable to dmake45.

Reassigning for verification.
Comment 5 quetschke 2006-06-14 00:52:53 UTC
Committed also a testcase.

@ause: Please verify.
Comment 6 hjs 2006-06-26 14:55:01 UTC
work
Comment 7 hjs 2006-07-07 15:22:37 UTC
.