Make dehydra notify about operator new/delete

RESOLVED FIXED

Status

()

Core
Rewriting and Analysis
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Benjamin Smedberg, Assigned: dmandelin)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
dehydra should give notifications for operator new/delete. Right now the only visible difference between:

A a;
A &a = *new A();

is the fact that it has a type:"A" instead of type:"A &". Neither the dereference operator nor the operator new is reported to dehydra.

Maybe I should file a separate bug about how dehydra doesn't ever seem to see operators?
(Assignee)

Comment 1

10 years ago
Created attachment 294990 [details] [diff] [review]
Proposed patch

Here's a patch that I think does the right thing. The output for A &a = *new A() will look like this:

dpm.ii:7: {name:"b", id:2, loc:"dpm.ii:7", type:"A *", isDecl:true, assign:[{name:"operator new", type:"A *", arguments:[{name:"constructor", type:"A &", arguments:[]}]}]}

Comment 2

10 years ago
The patch looks good except for the * handling. In dehydra there is an isDeref flag that should be set on name:"operator new", type:"A *",...} object.

Perhaps you can clean up my isDeref handling so it extends to this case too?
(Assignee)

Comment 3

10 years ago
I checked in the patch. isDeref support is harder so that's going to take a little longer.
Status: NEW → ASSIGNED
(Assignee)

Comment 4

10 years ago
Created attachment 294994 [details] [diff] [review]
deref patch

This is a further patch that adds a property 'isDeref=true' to the Dehydra variable for e in '*e' when e is represented by exactly one Dehydra variable. (Thus, *(p+5) does not get the isDeref property).
(Assignee)

Comment 5

10 years ago
Last patch in. Should be done with basic requirements.
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.