fix bugs
authorPeizhao Ou <peizhaoo@uci.edu>
Thu, 14 Nov 2013 02:34:38 +0000 (18:34 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Thu, 14 Nov 2013 02:34:38 +0000 (18:34 -0800)
notes/sequential_spec.txt
src/edu/uci/eecs/specCompiler/codeGenerator/CodeVariables.java

index 73e85cc..ef3baff 100644 (file)
@@ -75,7 +75,7 @@
    index = list.indexOf(elem);
    index = list.indexOf(elem, 1);
    7) PushAtIndex
-   list.pushAtIdex(1);
+   list.pushAtIndex(1);
    8) PushAfterElem
    list.pushAfterElem(target, elem, 10); // find the first matched target from index 10,
                                          // insert elem after target
index c9f6dde..4abd569 100644 (file)
@@ -33,6 +33,7 @@ public class CodeVariables {
 
        // Model checker code
        public static final String HEADER_CDSANNOTATE = "<cdsannotate.h>";
+       public static final String HEADER_COMMON = "<common.h>";
        public static final String HEADER_SPECANNOTATION = "<specannotation.h>";
        public static final String HEADER_CDSTRACE = "<cdstrace.h>";
 //     public static final String CDSAnnotate = "cdsannotate";
@@ -291,6 +292,7 @@ public class CodeVariables {
                newCode.add(INCLUDE(HEADER_STDLIB));
                newCode.add(INCLUDE(HEADER_STDINT));
                newCode.add(INCLUDE(HEADER_CDSANNOTATE));
+               newCode.add(INCLUDE(HEADER_COMMON));
                newCode.add(INCLUDE(HEADER_SPEC_LIB));
                newCode.add(INCLUDE(HEADER_SPECANNOTATION));
                newCode.add("");
@@ -362,7 +364,7 @@ public class CodeVariables {
                // Init func_ptr_table
                newCode.add(COMMENT("Init func_ptr_table"));
                newCode.add(ASSIGN("func_ptr_table",
-                               "(void**) malloc(sizeof(void*) * 2)"));
+                               "(void**) malloc(sizeof(void*) * " + semantics.interface2Num.size() + " * 2)"));
                for (String interfaceName : semantics.interfaceName2Construct.keySet()) {
                        String interfaceNum = Integer.toString(semantics.interface2Num
                                        .get(interfaceName));