Skip to content

Commit 8fdadad

Browse files
committed
1 parent fb451ca commit 8fdadad

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/gdlc.g

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ tokens {
137137
PARAEXPR_VN; // _VN Variable Number of parameters version
138138
DEC_REF_CHECK; // called from EvalRefCheck() (no temporary needed then)
139139
INC_REF_CHECK; // called from EvalRefCheck() (no temporary needed then)
140-
POSTDEC;
141-
POSTINC;
140+
POSTDEC; //post-decrement : i--
141+
POSTINC; // Post-increment : i++
142142
DECSTATEMENT; // as a statement
143143
INCSTATEMENT; // as a statement
144144
REF; // expr pass by reference
@@ -156,7 +156,7 @@ tokens {
156156
SYSVAR;
157157
// UPLUS;
158158
UMINUS;
159-
VAR; // varaible, referenced through index
159+
VAR; // variable, referenced through index
160160
VARPTR; // variable, referenced through pointer
161161
WHILE;
162162
}

src/prognode.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ void REF_CHECKVNNode::Parameter( EnvBaseT* actEnv)
906906
ProgNode::interpreter->_retTree = this->getNextSibling();
907907
}
908908

909+
//eval the single parameter of a libFunDirect() function (cos(),sin() etc)
909910
bool ParameterNode::ParameterDirect( BaseGDL*& pval)
910911
{
911912
pval = this->getFirstChild()->Eval();

src/prognodeexpr.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,10 @@ BaseGDL** DEREFNode::LEval()
684684
BaseGDL** QUESTIONNode::EvalRefCheck( BaseGDL*& rEval)
685685
{
686686
ProgNodeP branch = this->GetThisBranch();
687-
return branch->EvalRefCheck( rEval);
687+
rEval = branch->Eval();
688+
return NULL;
689+
//was: // return branch->EvalRefCheck( rEval);
690+
// but crash as reported in #1576 for "a=0 & b=0 & c=0 & z=cos( a ? b:c)" and other strange things.
688691
}
689692

690693
BaseGDL** QUESTIONNode::LEval()

src/prognodeexpr.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class FCALL_LIB_RETNEWNode: public LeafNode
109109
BaseGDL* Eval();
110110
};
111111

112+
//For nodes relative to a libFunDirect() function (cos(),sin() etc)
112113
class FCALL_LIB_DIRECTNode: public LeafNode
113114
{
114115
LibFunDirect libFunDirectFun;

0 commit comments

Comments
 (0)