Proposition to add a test case for CLIPS

xyando
2014-07-27
2014-08-24
  • xyando

    xyando - 2014-07-27

    To CLIPS maintainer

    Thanks for maintaining and developing the CLIPS.
    This is a proposition to add a test case for CLIPS.

    Executing the function 'foo' of default.clp make CLIPS to crash.
    A sample of patch is included.

    I am grad if this post is usefull for the robustness of CLIPS.

    Thanks.

    * default.clp *
    (defclass FOO (is-a USER)
    (slot _foo (default ?NONE))
    )

    (deffunction foo()
    (bind ?ins (make-instance of FOO (_foo)))
    )


    * insfun.c.patch
    --- core/insfun.c Sun Jul 27 17:09:12 2014
    +++ ./insfun.c Sun Jul 27 18:05:30 2014
    @@ -565,8 +565,19 @@
    (EXPRESSION
    ) sp->desc->defaultValue,val,TRUE))
    return(FALSE);
    }
    - else
    + else if (sp->desc->defaultValue)
    val = (DATA_OBJECT ) sp->desc->defaultValue;
    + else
    + {
    + PrintErrorID(theEnv,"INSFUN",9,FALSE);
    + EnvPrintRouter(theEnv,WERROR,"Can not evaluate default value for slot ");
    + EnvPrintRouter(theEnv,WTRACE,ValueToString(sp->desc->slotName->name));
    + EnvPrintRouter(theEnv,WTRACE," in instance ");
    + EnvPrintRouter(theEnv,WTRACE,ValueToString(ins->name));
    + EnvPrintRouter(theEnv,WERROR,".\n");
    + SetEvaluationError(theEnv,TRUE);
    + return(FALSE);
    + }
    }
    #if DEFRULE_CONSTRUCT
    if (EngineData(theEnv)->JoinOperationInProgress && sp->desc->reactive &&
    **
    *

     
    • Gary Riley

      Gary Riley - 2014-07-31

      Thanks for the report. A fix for this bug has been checked into the repository.

       
  • xyando

    xyando - 2014-08-24

    I have comfirmed it with r180.
    Thanks.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks