Skip to content

Commit

Permalink
Found the bug: Expressions need to handle errors in a memsafe way. Wi…
Browse files Browse the repository at this point in the history
…ll work on that.
  • Loading branch information
BenLand100 committed Jan 24, 2010
1 parent dfc12f5 commit d2604e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ Value* Value::incref(Value *val) throw(int,InterpEx*) {
}

Value* Value::decref(Value *val) throw(int,InterpEx*) {
if (!--val->refcount) {
delete val;
val = 0;
}
return val;
if (val->refcount > 5)
std::cout << "test " << val->refcount << '\n';
if (--val->refcount) return val;
delete val;
return 0;
}

Value::Value() : Element(ELEM_VALUE), typeObj(Type::getNil()), type(TYPE_NIL), refcount(1) {
Expand Down
2 changes: 1 addition & 1 deletion fpc/maze.pas
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ procedure benland100_solver(var jacks_path: TPointArray; var jills_routes: Integ
//writeln('d1:'+inttostr(length(maze)));
//writeln('d2:'+inttostr(length(maze[0])));
writeln('preparing to solve maze');
thin(input,start.x,start.y,finish.x,finish.y,length(input),length(input[0]));
//thin(input,start.x,start.y,finish.x,finish.y,length(input),length(input[0]));
writeln('thinned the maze');
//writeln('start: (' + inttostr(start.x) + ',' + inttostr(start.y) + ') finish: (' + inttostr(finish.x) + ',' + inttostr(finish.y) + ')');
all_paths:= flood(input,start.x,start.y,finish.x,finish.y,length(input),length(input[0]));
Expand Down
4 changes: 2 additions & 2 deletions nbproject/Makefile-Debug.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ OBJECTFILES= \
CFLAGS=

# CC Compiler Flags
CCFLAGS=-Wall
CXXFLAGS=-Wall
CCFLAGS=-Wall -O3
CXXFLAGS=-Wall -O3

# Fortran Compiler Flags
FFLAGS=
Expand Down
2 changes: 1 addition & 1 deletion nbproject/configurations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</toolsSet>
<compileType>
<ccTool>
<commandLine>-Wall</commandLine>
<commandLine>-Wall -O3</commandLine>
</ccTool>
<linkerTool>
<output>dist/Debug/${CND_PLATFORM}/cpascal</output>
Expand Down

0 comments on commit d2604e7

Please sign in to comment.