bugAxiom Computer Algebra System - Bugs: bug #4871, left hand side macro expansion...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #4871: left hand side macro expansion issue (was: Compiling spad file causes value stack overflow)

Submitted by:  Tim Daly <axiom>
Submitted on:  Thu 21 Aug 2003 01:25:18 AM UTC  
 
Category: build processSeverity: 3 - Normal
Item Group: code bugStatus: Fixed
Privacy: PublicAssigned to: Tim Daly <axiom>
Originator Name: Tim DalyOpen/Closed: Closed
Release: allReproducibility: None
Fixed Release: Sun, 5 Oct 2003 11:20:28 -0400
Error message: 

Value stack overflow

Example of code trigerring the bug: 

string.spad.pamphlet containing two copies of
MINSTRINGINDEX ==> 1

Internal cause: 

compOrCroak fails.

Macro expansion was wrongly done.

Wed 01 Oct 2003 04:41:02 PM UTC, comment #1:
[Fix (i.e. patch)]

According to Tim Daly, the issue is related to expansion of left hand side of macro:
http://mail.gnu.org/archive/html/axiom-developer/2003-08/msg00090.html

Juergen Weiss proposes following patch:
diff -c -r1.4 compiler.boot

      • compiler.boot 2003/06/20 20:58:11 1.4

--- compiler.boot 2003/09/30 20:07:31
***************

      • 670,686 ****

compMacro(form,m,e) ==
$macroIfTrue: local:= true
["MDEF",lhs,signature,specialCases,rhs]:= form
! rhs :=
rhs is ['CATEGORY,:.] => ['"-- the constructor category"]
rhs is ['Join,:.] => ['"-- the constructor category"]
rhs is ['CAPSULE,:.] => ['"-- the constructor capsule"]
rhs is ['add,:.] => ['"-- the constructor capsule"]
formatUnabbreviated rhs
sayBrightly ['" processing macro definition",'%b,
! :formatUnabbreviated lhs,'" ==> ",:rhs,'%d]
! ["MDEF",lhs,signature,specialCases,rhs]:= form:= macroExpand(form,e)
m=$EmptyMode or m=$NoValueMode =>
! ["/throwAway",$NoValueMode,put(first lhs,"macro",rhs,e)]

--% SEQ

--- 670,685 ----
compMacro(form,m,e) ==
$macroIfTrue: local:= true
["MDEF",lhs,signature,specialCases,rhs]:= form
! prhs :=
rhs is ['CATEGORY,:.] => ['"-- the constructor category"]
rhs is ['Join,:.] => ['"-- the constructor category"]
rhs is ['CAPSULE,:.] => ['"-- the constructor capsule"]
rhs is ['add,:.] => ['"-- the constructor capsule"]
formatUnabbreviated rhs
sayBrightly ['" processing macro definition",'%b,
! :formatUnabbreviated lhs,'" ==> ",:prhs,'%d]
m=$EmptyMode or m=$NoValueMode =>
! ["/throwAway",$NoValueMode,put(first lhs,"macro",macroExpand(rhs,e),e)]

--% SEQ

David Mentré <dmentre>
Project Administrator
Thu 21 Aug 2003 01:25:18 AM UTC, original submission:

Duplicate spad macro definitions in a spad file cause
the compiler to crash. The bug occurs in all versions of
the system (including original NAG versions).

Tim Daly <axiom>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 05 Oct 2003 03:51:09 PM UTCdmentreStatusNone=>(Error - Not Found)
  Open/ClosedFix proposed=>(Error - Not Found)
  Fixed Release=>
  Internal causecompOrCroak fails.=>
Wed 01 Oct 2003 04:41:02 PM UTCdmentreOpen/ClosedOpen=>(Error - Not Found)
  SummaryCompiling spad file causes value stack overflow=>

Back to the top


Powered by Savane 3.1-cleanup1