mirror of
https://github.com/fadden/6502bench.git
synced 2024-12-01 07:50:37 +00:00
Fix alignment check
The "is the .junk alignment directive correct" was returning true for subtype=None (not aligned), which caused execution to go down the wrong path and irritate an assert.
This commit is contained in:
parent
e2996d9b38
commit
ea94839bf6
@ -439,12 +439,13 @@ namespace SourceGen.AsmGen {
|
|||||||
/// <param name="offset">File offset of directive.</param>
|
/// <param name="offset">File offset of directive.</param>
|
||||||
/// <param name="dfd">Format descriptor.</param>
|
/// <param name="dfd">Format descriptor.</param>
|
||||||
/// <param name="addrMap">Offset to address map.</param>
|
/// <param name="addrMap">Offset to address map.</param>
|
||||||
/// <returns>True if the .junk alignment directive is correct.</returns>
|
/// <returns>True if the .junk alignment directive is correct, false if it's
|
||||||
|
/// incorrect or not an alignment sub-type (e.g. None).</returns>
|
||||||
public static bool CheckJunkAlign(int offset, FormatDescriptor dfd,
|
public static bool CheckJunkAlign(int offset, FormatDescriptor dfd,
|
||||||
CommonUtil.AddressMap addrMap) {
|
CommonUtil.AddressMap addrMap) {
|
||||||
Debug.Assert(dfd.FormatType == FormatDescriptor.Type.Junk);
|
Debug.Assert(dfd.FormatType == FormatDescriptor.Type.Junk);
|
||||||
if (dfd.FormatSubType == FormatDescriptor.SubType.None) {
|
if (dfd.FormatSubType == FormatDescriptor.SubType.None) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
Debug.Assert(dfd.IsAlignedJunk);
|
Debug.Assert(dfd.IsAlignedJunk);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user