shithub: rgbds

Download patch

ref: 6800609fa74f76f446b7e80cb7c81f072ec49fbd
parent: dac13ba4bbaccfd6f8e64466bb27826a18d7e7f1
author: ISSOtm <[email protected]>
date: Mon Feb 24 12:54:55 EST 2020

Make RGBLINK check divisions by zero

--- a/src/link/patch.c
+++ b/src/link/patch.c
@@ -163,6 +163,8 @@
 			break;
 		case RPN_DIV:
 			value = popRPN();
+			if (value == 0)
+				errx(1, "%s: Division by 0", patch->fileName);
 			value = popRPN() / value;
 			break;
 		case RPN_MOD: