Skip to content

Commit a0ccefb

Browse files
committed
refactor: Make initialpc on invalud number error handle edgecases
1 parent 7e9b95d commit a0ccefb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/context/SimulationContext.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ export function SimulationContextProvider({ children }: Props) {
153153
return
154154
}
155155

156+
if(parseInt(initialPC) % 4 != 0){
157+
toast.error("PC Address must be divisible by 4", {
158+
position: "bottom-left",
159+
description: "all MIPS addresses must be divisible by 4.",
160+
})
161+
162+
return;
163+
}
164+
156165
const value = editorRef.current.getValue()
157166

158167
const r = assemble(value, Number(initialPC))

0 commit comments

Comments
 (0)