Skip to content

solves #1576 #1579

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/gdlc.g
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ tokens {
PARAEXPR_VN; // _VN Variable Number of parameters version
DEC_REF_CHECK; // called from EvalRefCheck() (no temporary needed then)
INC_REF_CHECK; // called from EvalRefCheck() (no temporary needed then)
POSTDEC;
POSTINC;
POSTDEC; //post-decrement : i--
POSTINC; // Post-increment : i++
DECSTATEMENT; // as a statement
INCSTATEMENT; // as a statement
REF; // expr pass by reference
Expand All @@ -156,7 +156,7 @@ tokens {
SYSVAR;
// UPLUS;
UMINUS;
VAR; // varaible, referenced through index
VAR; // variable, referenced through index
VARPTR; // variable, referenced through pointer
WHILE;
}
Expand Down
1 change: 1 addition & 0 deletions src/prognode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ void REF_CHECKVNNode::Parameter( EnvBaseT* actEnv)
ProgNode::interpreter->_retTree = this->getNextSibling();
}

//eval the single parameter of a libFunDirect() function (cos(),sin() etc)
bool ParameterNode::ParameterDirect( BaseGDL*& pval)
{
pval = this->getFirstChild()->Eval();
Expand Down
5 changes: 4 additions & 1 deletion src/prognodeexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,10 @@ BaseGDL** DEREFNode::LEval()
BaseGDL** QUESTIONNode::EvalRefCheck( BaseGDL*& rEval)
{
ProgNodeP branch = this->GetThisBranch();
return branch->EvalRefCheck( rEval);
rEval = branch->Eval();
return NULL;
//was: // return branch->EvalRefCheck( rEval);
// but crash as reported in #1576 for "a=0 & b=0 & c=0 & z=cos( a ? b:c)" and other strange things.
}

BaseGDL** QUESTIONNode::LEval()
Expand Down
1 change: 1 addition & 0 deletions src/prognodeexpr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class FCALL_LIB_RETNEWNode: public LeafNode
BaseGDL* Eval();
};

//For nodes relative to a libFunDirect() function (cos(),sin() etc)
class FCALL_LIB_DIRECTNode: public LeafNode
{
LibFunDirect libFunDirectFun;
Expand Down