1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-09-27 03:16:55 +00:00

Fix junk alignment check

While adding a message log entry for failing alignment directives,
I noticed that the assembler source generator's test for valid
alignment was allowing some bad alignment values through.

I'm holding off on reporting the message to the log because not all
format changes cause a data-reanalysis, which means the log entry
doesn't always appear and disappear when it should.  If we decide
this is an important message we can add a scan for "softer" errors.
This commit is contained in:
Andy McFadden
2019-10-23 13:25:50 -07:00
parent 4ed2558f9f
commit 1844fcb8b7
3 changed files with 40 additions and 13 deletions

View File

@@ -392,6 +392,9 @@ namespace SourceGen {
/// Returns true if the sub-type is exclusively for use with the Junk type. Notably,
/// returns false for SubType.None.
/// </summary>
public bool IsAlignedJunk {
get { return IsJunkSubType(FormatSubType); }
}
private static bool IsJunkSubType(SubType subType) {
return ((int)subType >= (int)SubType.Align2 &&
(int)subType <= (int)SubType.Align65536);