Skip to content

Fix some typos #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FuzzTesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This subdirectory contains some [libFuzzer](https://www.llvm.org/docs/LibFuzzer.

## Requirements

- [Open Source Swift Toolchain](https://swift.org/install) - Xcode toolchain does not contain fuzzing supoort, so you need to install the open source toolchain.
- [Open Source Swift Toolchain](https://swift.org/install) - Xcode toolchain does not contain fuzzing support, so you need to install the open source toolchain.
- [wasm-tools](https://github.com/bytecodealliance/wasm-tools) - Required to generate random seed corpora

## libFuzzer-based Fuzzing Targets
Expand Down
6 changes: 4 additions & 2 deletions FuzzTesting/differential.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ def run(args):
# If the target program fails, save the wasm file
crash_file = os.path.join(fail_dir, f"diff-{i}.wasm")
shutil.copy(wasm_file, crash_file)
print(f"Found crash in iteration {i}")
print(f"Found crash in iteration {i};"
" reproduce with {args.program} {crash_file}")
except subprocess.TimeoutExpired:
timeout_file = os.path.join(fail_dir, f"timeout-{i}.wasm")
shutil.copy(wasm_file, timeout_file)
print(f"Timeout in iteration {i}")
print(f"Timeout in iteration {i};"
" reproduce with {args.program} {timeout_file})")
except KeyboardInterrupt:
print("Interrupted by user")
break
Expand Down
4 changes: 2 additions & 2 deletions Sources/SystemExtras/FileAtOperations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ extension FileDescriptor {
/// Create a symbolic link relative to a directory file descriptor
///
/// - Parameters:
/// - original: The path to be refered by the created symbolic link.
/// - original: The path to be referred by the created symbolic link.
/// - link: The relative location of the symbolic link to create
///
/// The corresponding C function is `symlinkat`.
Expand All @@ -287,7 +287,7 @@ extension FileDescriptor {
/// Create a symbolic link relative to a directory file descriptor
///
/// - Parameters:
/// - original: The path to be refered by the created symbolic link.
/// - original: The path to be referred by the created symbolic link.
/// - link: The relative location of the symbolic link to create
///
/// The corresponding C function is `symlinkat`.
Expand Down
2 changes: 1 addition & 1 deletion Sources/SystemExtras/Vendor/Exports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal func system_platform_strlen(_ s: UnsafePointer<CInterop.PlatformChar>)
#endif
}

// Interop between String and platfrom string
// Interop between String and platform string
extension String {
internal func _withPlatformString<Result>(
_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result
Expand Down
2 changes: 1 addition & 1 deletion Sources/WASI/Platform/Entry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ extension FdWASIEntry {
try WASIAbi.FileType(platformFileType: self.fd.attributes().fileType)
}

/// Returns the current file desciptor status
/// Returns the current file descriptor status
func status() throws -> WASIAbi.Fdflags {
return try WASIAbi.Errno.translatingPlatformErrno {
WASIAbi.Fdflags(platformOpenOptions: try self.fd.status())
Expand Down
8 changes: 4 additions & 4 deletions Sources/WASI/Platform/SandboxPrimitives/Open.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ struct PathResolution {
let options: FileDescriptor.OpenOptions
let mode: FileDescriptor.AccessMode
if !self.components.isEmpty {
var intermediateOtions: FileDescriptor.OpenOptions = []
var intermediateOptions: FileDescriptor.OpenOptions = []

#if !os(Windows)
// When trying to open an intermediate directory,
// we can assume it's directory.
intermediateOtions.insert(.directory)
intermediateOptions.insert(.directory)
// FIXME: Resolve symlink in safe way
intermediateOtions.insert(.noFollow)
intermediateOptions.insert(.noFollow)
#endif
options = intermediateOtions
options = intermediateOptions
mode = .readOnly
} else {
options = self.options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ struct StaticCanonicalDeallocation: CanonicalDeallocation {
pointer: Operand, length: Operand, element: WITType,
deallocateElement: (Pointer) throws -> Void
) throws {
let deallocElemenetVar = builder.variable("deallocElement")
printer.write(line: "let \(deallocElemenetVar): (UnsafeMutableRawPointer) -> Void = {")
let deallocElementVar = builder.variable("deallocElement")
printer.write(line: "let \(deallocElementVar): (UnsafeMutableRawPointer) -> Void = {")
try printer.indent {
printer.write(line: "_ = $0")
try deallocateElement(.init(basePointerVar: "$0", offset: 0))
}
printer.write(line: "}")
printer.write(
line: "Prelude.deallocateList(pointer: \(pointer), length: \(length), elementSize: \(CanonicalABI.size(type: element)), deallocateElement: \(deallocElemenetVar))"
line: "Prelude.deallocateList(pointer: \(pointer), length: \(length), elementSize: \(CanonicalABI.size(type: element)), deallocateElement: \(deallocElementVar))"
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ extension StaticCanonicalLowering {
return .accessField(value, name: "bitPattern")

case (.i64, .i32), (.i64, .f32), (.f64, .i32), (.f64, .f32):
fatalError("Should not trucate while casting")
fatalError("Should not truncate while casting")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ struct HostExportFunction {
let optionsVar = builder.variable("options")
printer.write(line: "let \(optionsVar) = CanonicalOptions._derive(from: instance, exportName: \"\(name.abiName)\")")
printer.write(line: "let \(context.contextVar) = CanonicalCallContext(options: \(optionsVar), instance: instance, runtime: runtime)")
// Supress unused variable warning for "context"
// Suppress unused variable warning for "context"
printer.write(line: "_ = \(context.contextVar)")

let arguments = try printLowerArguments(
Expand Down
4 changes: 2 additions & 2 deletions Tests/WITTests/Semantics/ValidationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ValidationTests: XCTestCase {
type a = u8
type b = a
}
// a shoud not be visible here
// a should not be visible here
type c = a
}
""",
Expand All @@ -130,7 +130,7 @@ class ValidationTests: XCTestCase {
type a = u8
type b = a
}
// a shoud not be visible here
// a should not be visible here
type c = a
}
""",
Expand Down