Menu

#73 CLIPS crashes when overloaded method is called.

1.0
closed
None
2023-06-20
2023-05-03
xyando
No

Hello,

The following commands makes CLIPS to crash.

         CLIPS (6.4.1 4/8/23)
CLIPS> (defmethod foo 1 ())
CLIPS> (defmethod foo ()
 (bind ?a 1))
CLIPS> (foo)
Segmentation fault (core dumped)

The patch below seems to fix this problem

diff -u core/genrcpsr.c mine/genrcpsr.c
--- core/genrcpsr.c 2017-10-11 23:43:28.000000000 +0900
+++ mine/genrcpsr.c 2023-04-30 21:13:02.091655570 +0900
@@ -499,13 +499,13 @@
    meth->actions = actions;
    ExpressionInstall(theEnv,meth->actions);
    meth->header.ppForm = ppForm;
+   meth->localVarCount = lvars;
    if (mposn == -1)
      {
       RestoreBusyCount(gfunc);
       return(meth);
      }

-   meth->localVarCount = lvars;
    meth->restrictionCount = rcnt;

    if (wildcard != NULL)

Thanks.

Discussion

  • Gary Riley

    Gary Riley - 2023-06-20
    • status: new --> closed
    • assigned_to: Gary Riley
     
  • Gary Riley

    Gary Riley - 2023-06-20

    Patch checked into repository for 6.4x and 6.3x branches.

     

Log in to post a comment.