bf: added notes regarding '{' and '<'.
This commit is contained in:
4
src/bf.c
4
src/bf.c
@@ -105,6 +105,8 @@ void program_execute(struct ProgramConcat *prg)
|
||||
switch (opcode)
|
||||
{
|
||||
case '<':
|
||||
// NOTE: We're doing a safe subtraction here, but maybe we should
|
||||
// terminate execution if subtraction will overflow?
|
||||
ctx.head0 = SAFE_SUB(ctx.head0, 1);
|
||||
++ctx.ip;
|
||||
break;
|
||||
@@ -113,6 +115,8 @@ void program_execute(struct ProgramConcat *prg)
|
||||
++ctx.ip;
|
||||
break;
|
||||
case '{':
|
||||
// NOTE: We're doing a safe subtraction here, but maybe we should
|
||||
// terminate execution if subtraction will overflow?
|
||||
ctx.head1 = SAFE_SUB(ctx.head1, 1);
|
||||
++ctx.ip;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user