Morpho-lang / Morpho-lang/morpho
[Bug] Internal consistency error: Incorrectly freed register in arg list
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 153
- Forks
- 22
- Avg merge
- 9d 10h
- Merged PRs (30d)
- 1
Description
Compiling the following gives a consistency error
import meshtools
import constants
fn mobius(r = 1, ratio = 0.5) {
var L = 2*r*ratio // Separation
var m = AreaMesh(fn(u,v) mobiusfn(u,v,r=r,ntwist=-1), -Pi..Pi:Pi/20,-L/2..L/2:L/10, closed=[false,false])
return m
}
fn mobiusfn(u,v, r = 1, ntwist=1){
var th = Matrix([cos(u), 0, sin(u)])
var twist = (cos(0.5*ntwist*u)*th + sin(0.5*ntwist*u)*Matrix([0,1,0]))
return r*th + v*twist
}
--Registers (7 in use)
r0 mobius [0]
r1 r [0] (captured)
r2 ratio [0]
r3 L [1]
r4 m [1]
r5 temporary [1]
r6 mobiusfn [1]
--End registers
Internal consistency error: Please contact developer. [Explanation: Incorrectly freed registers in compiling argument list.].
Reproduction script:
newconsitency.zip
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided newconsitency.zip reproduction script and tracing the compiler's argument-list handling when it reports incorrectly freed registers. Use the register dump and the failing Morpho example to identify the affected path. Done means the example compiles without the internal consistency error and register tracking remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100