Comments (4)
Not sure why this is happening yet, but I found out why the code freezes into an infinite loop when using a function in the asm code.
This exception is triggered:
"Collection was modified; enumeration operation may not execute."
at SymbolManager.cs:911
It get caught by the try in AssemblyController.cs (line 113), and as it doesn't have a specific handler, it ends up running this code instead:
else
{
Assembler.PassNeeded = true;
}
Which I assume cause the code to just get back into another pass, which trigger the same exception, etc etc.
I replaced that line of code by a simple throw; so at least my process stop when an exception is encountered (so I can print it).
I'll keep digging, just thought you might be interested to know :)
from 6502.net.
Ok looks like the IEnumerator ephemerals modify itself for some reason during its foreach loop, causing the exception. That makes no sense to me, whatsoever.
But as a dirty fix, I locally changed ephemerals to a List and that fixed my issue! Just... weird.
_ephemeralCounter--;
var ephemerals = new List<string>(_symbols.Keys.Where(k => k.Contains(sc, StringComparison.Ordinal)));
foreach (var key in ephemerals)
_symbols.Remove(key);
from 6502.net.
Oh I see: it's not that weird. ephemerals is a dynamic query of the _symbols table (the result collection is not created on the spot) so as soon as you call a Remove(), the whole enumerator is invalidated!
So this is a valid bug, but thankfully it's an easy fix :)
from 6502.net.
thank you @svallee-dev, you are right we have to essentially make ephemerals
a separate container of the symbols we are removing from _symbols
, which we are mutating. Good catch!
from 6502.net.
Related Issues (15)
- Symbol definition issues - Case sensitivity in macro parameters, assigning address type variables HOT 8
- Cannot use the +/- anonymous labels preceding a macro call HOT 4
- Underscore labels not working in macro arguments HOT 2
- Sixty502DotNetParser symbol not found? HOT 2
- Something I really miss: A simple way to assemble from string to byte[] HOT 3
- Incorrect assembly for the Z80 HOT 2
- Is there any way to relate the program counter to the line in the code? HOT 2
- Assigning a label broke recently HOT 19
- Negative numbers not supported HOT 1
- Cannot 'lda' with the 'least significant' operator for certain negative numbers HOT 2
- [Request] Custom Args HOT 2
- Suggestion: user controlled bank size. HOT 5
- Build Errors HOT 2
- Has concatenating macro arguments changed? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 6502.net.