Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue240 #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions share/prolog/oorules/rules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -672,18 +672,18 @@
% to a guessing rule.
reasonNOTDeletingDestructor_F(Method) :-
% Have we detected delete() at all in this program? If not, disable this rule.
insnCallsDelete(_Insn, _Method, _Ptr),
once(insnCallsDelete(_Insn, _Method, _Ptr)),

factMethod(Method),

% We don't call delete at all...
(not(insnCallsDelete(_, Method, _AnyPtr));
once((not(insnCallsDelete(_, Method, _AnyPtr));

% Or If we have thiscall, ensure we don't delete ourself
callingConvention(Method, '__thiscall'),
funcParameter(Method, ecx, ThisPtr),
% But we don't call delete on ourself
not(insnCallsDelete(_Insn2, Method, ThisPtr))),
not(insnCallsDelete(_Insn2, Method, ThisPtr)))),

logtraceln('~@~Q.', [not(factNOTDeletingDestructor(Method)),
reasonNOTDeletingDestructor_F(Method)]).
Expand Down Expand Up @@ -761,6 +761,9 @@
not((factVFTableWrite(_, Method, Offset, VFTable2), iso_dif(VFTable, VFTable2))),
methodCallAtOffset(CallAddr, Method, Callee, Offset),

% And there is no other method call at that offset
not((methodCallAtOffset(CallAddr2, Method, _, Offset), iso_dif(CallAddr, CallAddr2))),

% ejs 1/08/21: I believe that Offset can not be negative for a constructor or destructor
% because it is not possible to override them. Even though destructors can be virtual and
% overridden in a sense, you can not override the destructor of a specific base class.
Expand Down