Skip to content

Commit

Permalink
Merge pull request #88 from Absulit/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Absulit authored Dec 18, 2023
2 parents 25edc79 + 2308286 commit dbb1aa3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/data-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ export function getArrayAlign(structName, structData) {

export function getArrayTypeData(currentType, structData) {
const [d] = getArrayTypeAndAmount(currentType);
if(!d){
throw `${currentType} seems to have an error, maybe a wrong amount?`;
}
if (d.amount == 0) {
throw new Error(`${currentType} has an amount of 0`);
}
Expand All @@ -204,8 +207,8 @@ export function getArrayTypeData(currentType, structData) {
const t = typeSizes[d.type];
if (t) {
// if array, the size is equal to the align
// currentTypeData = { size: t.align * d.amount, align: t.align };
currentTypeData = { size: t.size * d.amount, align: t.align };
currentTypeData = { size: t.align * d.amount, align: t.align };
// currentTypeData = { size: t.size * d.amount, align: t.align };
// currentTypeData = { size: 0, align: 0 };
} else {
const sd = structData.get(d.type);
Expand Down

0 comments on commit dbb1aa3

Please sign in to comment.