[MAIN] [News] [Intro] [Features] [Download] [Installation] [Support] [Support+] [Docu] [Tutorial] [Bugs] [forum ] [wiki] [Mirror] [Authors] [Future] [License] [Win98 Setup Bug] [Subscribe] |
Bug DescriptionThe interpreter reports syntax error for all constant definitions where the constant value is positive and is written with a plus sign starting it. For example:const C= +1reports syntax error. The interpreter process causes segmentation fault for invalid constant declarations. For example the following program causes the interpreter crash: const C=then print C Bug Reason, What Causes the BugThere are programming bugs in the code that defines constants. It allows any lexical token to be assigned to a constant and later usage of constants assumes that the token represents a number or a string and crashes.SolutionUntil the next available release the source code has to be modified and recompiled. In expression.c search the lineif( LexemeType == LEX_T_NSYMBOL && ( LexemeCode == CMD_MINUS || LexemeCode == CMD_MINUS ) ){and alter it to if( LexemeType == LEX_T_NSYMBOL && ( LexemeCode == CMD_MINUS || LexemeCode == CMD_PLUS ) ){A few lines later search for pConstValue = pEx->pLex->pLexCurrentLexeme;and insert lines so that the check is done: if( LexemeType != LEX_T_DOUBLE && LexemeType != LEX_T_LONG && LexemeType != LEX_T_STRING )ABORT; pConstValue = pEx->pLex->pLexCurrentLexeme;After the modification recompile the code. Bug Workaround Until Solution is AvailableIn case you can not alter and recompile the code avoid using signed positive constants. Use the implicit positive value, like:const C=1Avoid programs that make the interpreter crash in production environment. AcknowledgementN/A |