-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: integer overflow in Complexity analysis (#2509)
* fix: integer overflow in Complexity analysis fixes #2508
- Loading branch information
Showing
12 changed files
with
99 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Souffle - A Datalog Compiler | ||
# Copyright (c) 2022 The Souffle Developers. All rights reserved | ||
# Licensed under the Universal Permissive License v 1.0 as shown at: | ||
# - https://opensource.org/licenses/UPL | ||
# - <souffle root>/licenses/SOUFFLE-UPL.txt | ||
|
||
add_library(issue2508 SHARED functors.cpp) | ||
target_include_directories(issue2508 PRIVATE "${CMAKE_SOURCE_DIR}/src/include") | ||
|
||
target_compile_features(issue2508 | ||
PUBLIC cxx_std_17) | ||
|
||
set_target_properties(issue2508 PROPERTIES CXX_EXTENSIONS OFF) | ||
set_target_properties(issue2508 PROPERTIES OUTPUT_NAME "functors") | ||
set_target_properties(issue2508 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
|
||
if (WIN32) | ||
# Prefix all shared libraries with 'lib'. | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "lib") | ||
|
||
# Prefix all static libraries with 'lib'. | ||
set(CMAKE_STATIC_LIBRARY_PREFIX "lib") | ||
endif () | ||
|
||
if (SOUFFLE_DOMAIN_64BIT) | ||
target_compile_definitions(issue2508 | ||
PUBLIC RAM_DOMAIN_SIZE=64) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "souffle/RecordTable.h" | ||
#include "souffle/SymbolTable.h" | ||
|
||
extern "C" { | ||
|
||
souffle::RamDomain id( | ||
souffle::SymbolTable* symbolTable, souffle::RecordTable* recordTable, souffle::RamDomain x) { | ||
return x; | ||
} | ||
|
||
souffle::RamDomain decode( | ||
souffle::SymbolTable* symbolTable, souffle::RecordTable* recordTable, souffle::RamDomain x) { | ||
symbolTable->decode(x); | ||
return x; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.functor id(symbol): symbol stateful | ||
.functor decode(symbol): symbol stateful | ||
|
||
.type T = C1 {A0 : symbol} | C2 {A0: number} | ||
|
||
.decl A(A2: T) | ||
.decl B() | ||
.output B() | ||
.decl C() | ||
.output C() | ||
|
||
A($C2(10000000)). | ||
A($C1("X")). | ||
A($C1("Y")). | ||
|
||
B() :- | ||
A($C1(X)), | ||
(@decode(X) = @id("Y")). | ||
|
||
C() :- | ||
A($C2(_)). | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters